Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
81fce4c5
Commit
81fce4c5
authored
Jun 24, 2019
by
Rahix
Browse files
Merge branch 'rahix/clean-warnings' into 'master'
Clean warnings See merge request
card10/firmware!10
parents
f49d850f
ccf8d648
Changes
18
Hide whitespace changes
Inline
Side-by-side
bootloader/build_multi_image.sh
View file @
81fce4c5
#!/bin/sh
set
-e
echo
"build multi image"
$1
$2
$3
$4
PYTHON
=
"
$1
"
BIN1
=
"
$2
"
BIN2
=
"
$3
"
BINOUT
=
"
$4
"
dd
if
=
/dev/zero
ibs
=
1k
count
=
448 |
tr
"
\0
00"
"
\3
77"
>
"
$BINOUT
"
dd
if
=
"
$BIN1
"
of
=
"
$BINOUT
"
conv
=
notrunc
dd
if
=
"
$BIN2
"
of
=
"
$BINOUT
"
conv
=
notrunc
oflag
=
append
dd
if
=
/dev/zero
ibs
=
1k
count
=
448
2>/dev/null
|
tr
"
\0
00"
"
\3
77"
>
"
$BINOUT
"
dd
if
=
"
$BIN1
"
of
=
"
$BINOUT
"
conv
=
notrunc
2>/dev/null
dd
if
=
"
$BIN2
"
of
=
"
$BINOUT
"
conv
=
notrunc
oflag
=
append
2>/dev/null
"
$PYTHON
"
"
$(
dirname
"
$0
"
)
/crc_patch.py"
"
$BINOUT
"
bootloader/crc_patch.py
View file @
81fce4c5
...
...
@@ -2,16 +2,19 @@
import
sys
import
crc16
crc
=
0
data
=
open
(
sys
.
argv
[
1
],
'rb'
).
read
()
crc
=
crc16
.
crc16xmodem
(
data
)
print
(
crc
)
def
main
():
data
=
open
(
sys
.
argv
[
1
],
'rb'
).
read
()
crc
=
crc16
.
crc16xmodem
(
data
)
# print(crc)
padded
=
data
+
bytes
([
crc
>>
8
,
crc
&
0xFF
])
padded
=
data
+
bytes
([
crc
>>
8
,
crc
&
0xFF
])
crc
=
0
crc
=
crc16
.
crc16xmodem
(
padded
)
print
(
crc
)
crc
=
crc16
.
crc16xmodem
(
padded
)
# print(crc)
open
(
sys
.
argv
[
1
],
'wb'
).
write
(
padded
)
open
(
sys
.
argv
[
1
],
'wb'
).
write
(
padded
)
if
__name__
==
"__main__"
:
main
()
bootloader/main.c
View file @
81fce4c5
...
...
@@ -13,6 +13,7 @@
#include
"led.h"
#include
"ff.h"
#include
"crc16-ccitt.h"
#include
"pb.h"
#define GPIO_PORT_IN PORT_1
...
...
@@ -161,6 +162,8 @@ static inline void boot(const void * vtable){
SCB
->
VTOR
=
(
uintptr_t
)
vtable
;
// Reset stack pointer & branch to the new reset vector.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
__asm
(
"mov r0, %0
\n
"
"ldr sp, [r0]
\n
"
"ldr r0, [r0, #4]
\n
"
...
...
@@ -168,6 +171,7 @@ static inline void boot(const void * vtable){
:
:
"r"
(
vtable
)
:
"%sp"
,
"r0"
);
#pragma GCC diagnostic pop
};
...
...
epicardium/api/genapi.py
View file @
81fce4c5
...
...
@@ -201,7 +201,7 @@ void __api_dispatch_call(uint32_t id, void*buffer)
tmp
=
"""
\
default:
/* TODO: Better error handling */
printf("Error: API function %x is unknown!!
\\
n", id);
printf("Error: API function %
l
x is unknown!!
\\
n", id);
break;
}}
}}
...
...
hw-tests/bmetest/main.c
View file @
81fce4c5
...
...
@@ -79,25 +79,25 @@ int main(void)
struct
bme680_field_data
data
;
rslt
=
bme680_get_sensor_data
(
&
data
,
&
gas_sensor
);
printf
(
"T: %.2f degC, P: %.2f hPa, H %.2f %%rH "
,
data
.
temperature
/
100
.
0l
,
printf
(
"T: %.2
L
f degC, P: %.2
L
f hPa, H %.2
L
f %%rH "
,
data
.
temperature
/
100
.
0l
,
data
.
pressure
/
100
.
0l
,
data
.
humidity
/
1000
.
0l
);
char
buf
[
128
];
sprintf
(
buf
,
"T: %.2f degC"
,
data
.
temperature
/
100
.
0l
);
sprintf
(
buf
,
"T: %.2
L
f degC"
,
data
.
temperature
/
100
.
0l
);
Paint_DrawString_EN
(
0
,
0
,
buf
,
&
Font16
,
0x0000
,
0xffff
);
sprintf
(
buf
,
"P: %.2f hPa"
,
data
.
pressure
/
100
.
0l
);
sprintf
(
buf
,
"P: %.2
L
f hPa"
,
data
.
pressure
/
100
.
0l
);
Paint_DrawString_EN
(
0
,
16
,
buf
,
&
Font16
,
0x0000
,
0xffff
);
sprintf
(
buf
,
"H: %.2f %%rH"
,
data
.
humidity
/
1000
.
0l
);
sprintf
(
buf
,
"H: %.2
L
f %%rH"
,
data
.
humidity
/
1000
.
0l
);
Paint_DrawString_EN
(
0
,
32
,
buf
,
&
Font16
,
0x0000
,
0xffff
);
//printf("%.2f,%.2f,%.2f\n", data.temperature / 100.0f,
// data.pressure / 100.0f, data.humidity / 1000.0f );
/* Avoid using measurements from an unstable heating setup */
if
(
data
.
status
&
BME680_GASM_VALID_MSK
)
{
printf
(
", G: %d ohms"
,
data
.
gas_resistance
);
sprintf
(
buf
,
"G: %d ohms"
,
data
.
gas_resistance
);
printf
(
", G: %
l
d ohms"
,
data
.
gas_resistance
);
sprintf
(
buf
,
"G: %
l
d ohms"
,
data
.
gas_resistance
);
Paint_DrawString_EN
(
0
,
48
,
buf
,
&
Font16
,
0x0000
,
0xffff
);
}
...
...
hw-tests/dual-core/core1.c
View file @
81fce4c5
...
...
@@ -2,7 +2,7 @@
#include
"gpio.h"
#include
"mxc_delay.h"
static
const
gpio_cfg_t
motor_pin
=
{
PORT_0
,
PIN_8
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
static
const
__attribute__
((
unused
))
gpio_cfg_t
motor_pin
=
{
PORT_0
,
PIN_8
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
int
main
(
void
)
{
...
...
hw-tests/ecgtest/main.c
View file @
81fce4c5
...
...
@@ -14,6 +14,7 @@
#include
"i2c.h"
#include
"rtc.h"
#include
"spi.h"
#include
"pb.h"
#include
"MAX30003.h"
#include
"GUI_DEV/GUI_Paint.h"
#include
"pmic.h"
...
...
@@ -53,7 +54,7 @@ static uint32_t ecg_read_reg(uint8_t reg)
static
void
ecg_write_reg
(
uint8_t
reg
,
uint32_t
data
)
{
printf
(
"write %02x %06x
\n
"
,
reg
,
data
);
printf
(
"write %02x %06
l
x
\n
"
,
reg
,
data
);
spi_req_t
req
;
uint8_t
tx_data
[]
=
{(
reg
<<
1
)
|
0
,
data
>>
16
,
(
data
>>
8
)
&
0xFF
,
data
&
0xFF
};
uint8_t
rx_data
[]
=
{
0
,
0
,
0
,
0
};
...
...
@@ -407,7 +408,7 @@ int main(void)
for
(
int
i
=
0
;
i
<
0x20
;
i
++
)
{
uint32_t
val
=
ecg_read_reg
(
i
);
printf
(
"%02x: 0x%06x
\n
"
,
i
,
val
);
printf
(
"%02x: 0x%06
l
x
\n
"
,
i
,
val
);
}
ecg_write_reg
(
SYNCH
,
0
);
...
...
hw-tests/hello-freertos/CLI-commands.c
View file @
81fce4c5
...
...
@@ -200,11 +200,11 @@ static BaseType_t prvUptimeCommand(char *pcWriteBuffer, size_t xWriteBufferLen,
#if configUSE_TICKLESS_IDLE
pcWriteBuffer
+=
snprintf
(
pcWriteBuffer
,
xWriteBufferLen
,
"Uptime is 0x%08x (%u ms)
\r\n
MXC_RTCTMR->timer is %u
\r\n
"
,
"Uptime is 0x%08
l
x (%
l
u ms)
\r\n
MXC_RTCTMR->timer is %
l
u
\r\n
"
,
ticks
,
ticks
/
portTICK_PERIOD_MS
,
MXC_RTC
->
sec
);
#else
pcWriteBuffer
+=
snprintf
(
pcWriteBuffer
,
xWriteBufferLen
,
"Uptime is 0x%08x (%u ms)
\r\n
"
,
"Uptime is 0x%08
l
x (%
l
u ms)
\r\n
"
,
ticks
,
ticks
/
portTICK_PERIOD_MS
);
#endif
...
...
@@ -257,7 +257,7 @@ static BaseType_t lParameterNumber = 0;
memset
(
pcWriteBuffer
,
0x00
,
xWriteBufferLen
);
sprintf
(
pcWriteBuffer
,
"%d: "
,
(
int
)
lParameterNumber
);
strncat
(
pcWriteBuffer
,
pcParameter
,
lParameterStringLength
);
str
n
cat
(
pcWriteBuffer
,
"
\r\n
"
,
strlen
(
"
\r\n
"
)
);
strcat
(
pcWriteBuffer
,
"
\r\n
"
);
/* If this is the last of the three parameters then there are no more
strings to return after this one. */
...
...
@@ -323,7 +323,7 @@ static BaseType_t lParameterNumber = 0;
memset
(
pcWriteBuffer
,
0x00
,
xWriteBufferLen
);
sprintf
(
pcWriteBuffer
,
"%d: "
,
(
int
)
lParameterNumber
);
strncat
(
pcWriteBuffer
,
pcParameter
,
lParameterStringLength
);
str
n
cat
(
pcWriteBuffer
,
"
\r\n
"
,
strlen
(
"
\r\n
"
)
);
strcat
(
pcWriteBuffer
,
"
\r\n
"
);
/* There might be more parameters to return after this one. */
xReturn
=
pdTRUE
;
...
...
hw-tests/hello-freertos/main.c
View file @
81fce4c5
...
...
@@ -186,7 +186,7 @@ void vTickTockTask(void *pvParameters)
while
(
1
)
{
ticks
=
xTaskGetTickCount
();
printf
(
"Uptime is 0x%08x (%u seconds), tickless-idle is %s
\n
"
,
printf
(
"Uptime is 0x%08
l
x (%
l
u seconds), tickless-idle is %s
\n
"
,
ticks
,
ticks
/
configTICK_RATE_HZ
,
disable_tickless
?
"disabled"
:
"ENABLED"
);
vTaskDelayUntil
(
&
xLastWakeTime
,
(
configTICK_RATE_HZ
*
60
));
...
...
hw-tests/hello-world/main.c
View file @
81fce4c5
...
...
@@ -19,7 +19,7 @@
/***** Definitions *****/
/***** Globals *****/
static
const
gpio_cfg_t
motor_pin
=
{
PORT_0
,
PIN_8
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
static
__attribute__
((
unused
))
const
gpio_cfg_t
motor_pin
=
{
PORT_0
,
PIN_8
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
int
main
(
void
)
{
...
...
@@ -35,7 +35,7 @@ int main(void)
leds_set_dim
(
i
,
1
);
}
int
h
=
0
;
int
__attribute__
((
unused
))
h
=
0
;
while
(
1
)
{
#if 0
...
...
hw-tests/imutest/main.c
View file @
81fce4c5
...
...
@@ -101,7 +101,7 @@ static void sensors_callback_orientation(bhy_data_generic_t * sensor_data, bhy_v
}
static
void
sensors_callback_vector
(
bhy_data_generic_t
*
sensor_data
,
bhy_virtual_sensor_t
sensor_id
)
static
__attribute__
((
unused
))
void
sensors_callback_vector
(
bhy_data_generic_t
*
sensor_data
,
bhy_virtual_sensor_t
sensor_id
)
{
printf
(
"x=%05d, y=%05d, z=%05d status=%d
\n
"
,
sensor_data
->
data_vector
.
x
,
...
...
@@ -111,7 +111,7 @@ static void sensors_callback_vector(bhy_data_generic_t * sensor_data, bhy_virtua
);
}
static
void
sensors_callback_vector_uncalib
(
bhy_data_generic_t
*
sensor_data
,
bhy_virtual_sensor_t
sensor_id
)
static
__attribute__
((
unused
))
void
sensors_callback_vector_uncalib
(
bhy_data_generic_t
*
sensor_data
,
bhy_virtual_sensor_t
sensor_id
)
{
printf
(
"x=%05d, y=%05d, z=%05d status=%d
\n
"
,
sensor_data
->
data_uncalib_vector
.
x
,
...
...
@@ -128,7 +128,7 @@ static void sensors_callback_vector_uncalib(bhy_data_generic_t * sensor_data, bh
* @param[in] sensor_data
* @param[in] sensor_id
*/
static
void
sensors_callback_rotation_vector
(
bhy_data_generic_t
*
sensor_data
,
bhy_virtual_sensor_t
sensor_id
)
static
__attribute__
((
unused
))
void
sensors_callback_rotation_vector
(
bhy_data_generic_t
*
sensor_data
,
bhy_virtual_sensor_t
sensor_id
)
{
#if 0
float temp;
...
...
lib/card10/card10.c
View file @
81fce4c5
...
...
@@ -170,7 +170,7 @@ void card10_diag(void)
}
#else
uint32_t
val
=
ecg_read_reg
(
0xf
);
printf
(
"ECG: %02x: 0x%06x (should be 0x5139a0)
\n
"
,
0xf
,
val
);
printf
(
"ECG: %02x: 0x%06
l
x (should be 0x5139a0)
\n
"
,
0xf
,
val
);
#endif
}
...
...
lib/gfx/display.c
View file @
81fce4c5
...
...
@@ -7,7 +7,6 @@
#include
<stdint.h>
#include
<stdio.h>
/***** Globals *****/
static
const
gpio_cfg_t
motor_pin
=
{
PORT_0
,
PIN_8
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
//const gpio_cfg_t DEV_RST_PIN = {PORT_0, PIN_28, GPIO_FUNC_OUT, GPIO_PAD_NONE};
const
gpio_cfg_t
DEV_DC_PIN
=
{
PORT_1
,
PIN_6
,
GPIO_FUNC_OUT
,
GPIO_PAD_NONE
};
...
...
lib/micropython/gen-version.sh
View file @
81fce4c5
...
...
@@ -10,4 +10,4 @@ mkdir -p "$OUTDIR/genhdr"
ln
-sfr
"
$OUT
"
"
$OUTDIR
/genhdr/
$(
basename
"
$OUT
"
)
"
cd
"
$2
/micropython"
"
$1
"
"
$2
/micropython/py/makeversionhdr.py"
"
$OUT
"
"
$1
"
"
$2
/micropython/py/makeversionhdr.py"
"
$OUT
"
>
/dev/null
lib/sdk/Libraries/MAX32665PeriphDriver/meson.build
View file @
81fce4c5
...
...
@@ -52,6 +52,7 @@ lib = static_library(
'PeriphDriver',
sources,
include_directories: includes,
c_args: '-w',
)
periphdriver = declare_dependency(
...
...
lib/sdk/Libraries/MAXUSB/meson.build
View file @
81fce4c5
...
...
@@ -24,6 +24,7 @@ lib = static_library(
sources,
include_directories: includes,
dependencies: periphdriver,
c_args: '-w',
)
maxusb = declare_dependency(
...
...
lib/vendor/Bosch/BHy1/meson.build
View file @
81fce4c5
...
...
@@ -16,6 +16,7 @@ lib = static_library(
sources,
include_directories: includes,
dependencies: periphdriver,
c_args: '-w',
)
bhy1 = declare_dependency(
...
...
lib/vendor/Maxim/MAX86150/meson.build
View file @
81fce4c5
...
...
@@ -6,6 +6,7 @@ lib = static_library(
'max86150',
'max86150.c',
dependencies: periphdriver,
c_args: '-w',
)
max86150 = declare_dependency(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment