Skip to content
Snippets Groups Projects
Verified Commit ccf8d648 authored by rahix's avatar rahix
Browse files

chore: Fix most compiler warnings (or disable them for vendor code)


Signed-off-by: default avatarRahix <rahix@rahix.de>
parent 80961d1f
No related branches found
No related tags found
No related merge requests found
Showing with 31 additions and 23 deletions
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "led.h" #include "led.h"
#include "ff.h" #include "ff.h"
#include "crc16-ccitt.h" #include "crc16-ccitt.h"
#include "pb.h"
#define GPIO_PORT_IN PORT_1 #define GPIO_PORT_IN PORT_1
...@@ -161,6 +162,8 @@ static inline void boot(const void * vtable){ ...@@ -161,6 +162,8 @@ static inline void boot(const void * vtable){
SCB->VTOR = (uintptr_t) vtable; SCB->VTOR = (uintptr_t) vtable;
// Reset stack pointer & branch to the new reset vector. // Reset stack pointer & branch to the new reset vector.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"
__asm( "mov r0, %0\n" __asm( "mov r0, %0\n"
"ldr sp, [r0]\n" "ldr sp, [r0]\n"
"ldr r0, [r0, #4]\n" "ldr r0, [r0, #4]\n"
...@@ -168,6 +171,7 @@ static inline void boot(const void * vtable){ ...@@ -168,6 +171,7 @@ static inline void boot(const void * vtable){
: :
: "r"(vtable) : "r"(vtable)
: "%sp", "r0"); : "%sp", "r0");
#pragma GCC diagnostic pop
}; };
......
...@@ -201,7 +201,7 @@ void __api_dispatch_call(uint32_t id, void*buffer) ...@@ -201,7 +201,7 @@ void __api_dispatch_call(uint32_t id, void*buffer)
tmp = """\ tmp = """\
default: default:
/* TODO: Better error handling */ /* TODO: Better error handling */
printf("Error: API function %x is unknown!!\\n", id); printf("Error: API function %lx is unknown!!\\n", id);
break; break;
}} }}
}} }}
......
...@@ -79,25 +79,25 @@ int main(void) ...@@ -79,25 +79,25 @@ int main(void)
struct bme680_field_data data; struct bme680_field_data data;
rslt = bme680_get_sensor_data(&data, &gas_sensor); rslt = bme680_get_sensor_data(&data, &gas_sensor);
printf("T: %.2f degC, P: %.2f hPa, H %.2f %%rH ", data.temperature / 100.0l, printf("T: %.2Lf degC, P: %.2Lf hPa, H %.2Lf %%rH ", data.temperature / 100.0l,
data.pressure / 100.0l, data.humidity / 1000.0l ); data.pressure / 100.0l, data.humidity / 1000.0l );
char buf[128]; char buf[128];
sprintf(buf, "T: %.2f degC", data.temperature / 100.0l); sprintf(buf, "T: %.2Lf degC", data.temperature / 100.0l);
Paint_DrawString_EN(0, 0, buf, &Font16, 0x0000, 0xffff); Paint_DrawString_EN(0, 0, buf, &Font16, 0x0000, 0xffff);
sprintf(buf, "P: %.2f hPa", data.pressure / 100.0l); sprintf(buf, "P: %.2Lf hPa", data.pressure / 100.0l);
Paint_DrawString_EN(0, 16, buf, &Font16, 0x0000, 0xffff); Paint_DrawString_EN(0, 16, buf, &Font16, 0x0000, 0xffff);
sprintf(buf, "H: %.2f %%rH", data.humidity / 1000.0l); sprintf(buf, "H: %.2Lf %%rH", data.humidity / 1000.0l);
Paint_DrawString_EN(0, 32, buf, &Font16, 0x0000, 0xffff); Paint_DrawString_EN(0, 32, buf, &Font16, 0x0000, 0xffff);
//printf("%.2f,%.2f,%.2f\n", data.temperature / 100.0f, //printf("%.2f,%.2f,%.2f\n", data.temperature / 100.0f,
// data.pressure / 100.0f, data.humidity / 1000.0f ); // data.pressure / 100.0f, data.humidity / 1000.0f );
/* Avoid using measurements from an unstable heating setup */ /* Avoid using measurements from an unstable heating setup */
if(data.status & BME680_GASM_VALID_MSK) { if(data.status & BME680_GASM_VALID_MSK) {
printf(", G: %d ohms", data.gas_resistance); printf(", G: %ld ohms", data.gas_resistance);
sprintf(buf, "G: %d ohms", data.gas_resistance); sprintf(buf, "G: %ld ohms", data.gas_resistance);
Paint_DrawString_EN(0, 48, buf, &Font16, 0x0000, 0xffff); Paint_DrawString_EN(0, 48, buf, &Font16, 0x0000, 0xffff);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "gpio.h" #include "gpio.h"
#include "mxc_delay.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) int main(void)
{ {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "i2c.h" #include "i2c.h"
#include "rtc.h" #include "rtc.h"
#include "spi.h" #include "spi.h"
#include "pb.h"
#include "MAX30003.h" #include "MAX30003.h"
#include "GUI_DEV/GUI_Paint.h" #include "GUI_DEV/GUI_Paint.h"
#include "pmic.h" #include "pmic.h"
...@@ -53,7 +54,7 @@ static uint32_t ecg_read_reg(uint8_t reg) ...@@ -53,7 +54,7 @@ static uint32_t ecg_read_reg(uint8_t reg)
static void ecg_write_reg(uint8_t reg, uint32_t data) static void ecg_write_reg(uint8_t reg, uint32_t data)
{ {
printf("write %02x %06x\n", reg, data); printf("write %02x %06lx\n", reg, data);
spi_req_t req; spi_req_t req;
uint8_t tx_data[] = {(reg << 1) | 0 , data >> 16, (data >> 8 ) & 0xFF, data & 0xFF}; uint8_t tx_data[] = {(reg << 1) | 0 , data >> 16, (data >> 8 ) & 0xFF, data & 0xFF};
uint8_t rx_data[] = {0, 0, 0, 0}; uint8_t rx_data[] = {0, 0, 0, 0};
...@@ -407,7 +408,7 @@ int main(void) ...@@ -407,7 +408,7 @@ int main(void)
for(int i=0; i<0x20; i++) { for(int i=0; i<0x20; i++) {
uint32_t val = ecg_read_reg(i); uint32_t val = ecg_read_reg(i);
printf("%02x: 0x%06x\n", i, val); printf("%02x: 0x%06lx\n", i, val);
} }
ecg_write_reg(SYNCH, 0); ecg_write_reg(SYNCH, 0);
......
...@@ -200,11 +200,11 @@ static BaseType_t prvUptimeCommand(char *pcWriteBuffer, size_t xWriteBufferLen, ...@@ -200,11 +200,11 @@ static BaseType_t prvUptimeCommand(char *pcWriteBuffer, size_t xWriteBufferLen,
#if configUSE_TICKLESS_IDLE #if configUSE_TICKLESS_IDLE
pcWriteBuffer += snprintf(pcWriteBuffer, xWriteBufferLen, pcWriteBuffer += snprintf(pcWriteBuffer, xWriteBufferLen,
"Uptime is 0x%08x (%u ms)\r\nMXC_RTCTMR->timer is %u\r\n", "Uptime is 0x%08lx (%lu ms)\r\nMXC_RTCTMR->timer is %lu\r\n",
ticks, ticks / portTICK_PERIOD_MS, MXC_RTC->sec); ticks, ticks / portTICK_PERIOD_MS, MXC_RTC->sec);
#else #else
pcWriteBuffer += snprintf(pcWriteBuffer, xWriteBufferLen, pcWriteBuffer += snprintf(pcWriteBuffer, xWriteBufferLen,
"Uptime is 0x%08x (%u ms)\r\n", "Uptime is 0x%08lx (%lu ms)\r\n",
ticks, ticks / portTICK_PERIOD_MS); ticks, ticks / portTICK_PERIOD_MS);
#endif #endif
...@@ -257,7 +257,7 @@ static BaseType_t lParameterNumber = 0; ...@@ -257,7 +257,7 @@ static BaseType_t lParameterNumber = 0;
memset( pcWriteBuffer, 0x00, xWriteBufferLen ); memset( pcWriteBuffer, 0x00, xWriteBufferLen );
sprintf( pcWriteBuffer, "%d: ", (int)lParameterNumber ); sprintf( pcWriteBuffer, "%d: ", (int)lParameterNumber );
strncat( pcWriteBuffer, pcParameter, lParameterStringLength ); strncat( pcWriteBuffer, pcParameter, lParameterStringLength );
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) ); strcat( pcWriteBuffer, "\r\n");
/* If this is the last of the three parameters then there are no more /* If this is the last of the three parameters then there are no more
strings to return after this one. */ strings to return after this one. */
...@@ -323,7 +323,7 @@ static BaseType_t lParameterNumber = 0; ...@@ -323,7 +323,7 @@ static BaseType_t lParameterNumber = 0;
memset( pcWriteBuffer, 0x00, xWriteBufferLen ); memset( pcWriteBuffer, 0x00, xWriteBufferLen );
sprintf( pcWriteBuffer, "%d: ", (int)lParameterNumber ); sprintf( pcWriteBuffer, "%d: ", (int)lParameterNumber );
strncat( pcWriteBuffer, pcParameter, lParameterStringLength ); strncat( pcWriteBuffer, pcParameter, lParameterStringLength );
strncat( pcWriteBuffer, "\r\n", strlen( "\r\n" ) ); strcat( pcWriteBuffer, "\r\n");
/* There might be more parameters to return after this one. */ /* There might be more parameters to return after this one. */
xReturn = pdTRUE; xReturn = pdTRUE;
......
...@@ -186,7 +186,7 @@ void vTickTockTask(void *pvParameters) ...@@ -186,7 +186,7 @@ void vTickTockTask(void *pvParameters)
while (1) { while (1) {
ticks = xTaskGetTickCount(); ticks = xTaskGetTickCount();
printf("Uptime is 0x%08x (%u seconds), tickless-idle is %s\n", printf("Uptime is 0x%08lx (%lu seconds), tickless-idle is %s\n",
ticks, ticks / configTICK_RATE_HZ, ticks, ticks / configTICK_RATE_HZ,
disable_tickless ? "disabled" : "ENABLED"); disable_tickless ? "disabled" : "ENABLED");
vTaskDelayUntil(&xLastWakeTime, (configTICK_RATE_HZ * 60)); vTaskDelayUntil(&xLastWakeTime, (configTICK_RATE_HZ * 60));
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/***** Definitions *****/ /***** Definitions *****/
/***** Globals *****/ /***** 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) int main(void)
{ {
...@@ -35,7 +35,7 @@ int main(void) ...@@ -35,7 +35,7 @@ int main(void)
leds_set_dim(i, 1); leds_set_dim(i, 1);
} }
int h = 0; int __attribute__((unused)) h = 0;
while (1) { while (1) {
#if 0 #if 0
......
...@@ -101,7 +101,7 @@ static void sensors_callback_orientation(bhy_data_generic_t * sensor_data, bhy_v ...@@ -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", printf("x=%05d, y=%05d, z=%05d status=%d\n",
sensor_data->data_vector.x, sensor_data->data_vector.x,
...@@ -111,7 +111,7 @@ static void sensors_callback_vector(bhy_data_generic_t * sensor_data, bhy_virtua ...@@ -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", printf("x=%05d, y=%05d, z=%05d status=%d\n",
sensor_data->data_uncalib_vector.x, sensor_data->data_uncalib_vector.x,
...@@ -128,7 +128,7 @@ static void sensors_callback_vector_uncalib(bhy_data_generic_t * sensor_data, bh ...@@ -128,7 +128,7 @@ static void sensors_callback_vector_uncalib(bhy_data_generic_t * sensor_data, bh
* @param[in] sensor_data * @param[in] sensor_data
* @param[in] sensor_id * @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 #if 0
float temp; float temp;
......
...@@ -170,7 +170,7 @@ void card10_diag(void) ...@@ -170,7 +170,7 @@ void card10_diag(void)
} }
#else #else
uint32_t val = ecg_read_reg(0xf); uint32_t val = ecg_read_reg(0xf);
printf("ECG: %02x: 0x%06x (should be 0x5139a0)\n", 0xf, val); printf("ECG: %02x: 0x%06lx (should be 0x5139a0)\n", 0xf, val);
#endif #endif
} }
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
/***** Globals *****/ /***** 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_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}; const gpio_cfg_t DEV_DC_PIN = {PORT_1, PIN_6, GPIO_FUNC_OUT, GPIO_PAD_NONE};
......
...@@ -10,4 +10,4 @@ mkdir -p "$OUTDIR/genhdr" ...@@ -10,4 +10,4 @@ mkdir -p "$OUTDIR/genhdr"
ln -sfr "$OUT" "$OUTDIR/genhdr/$(basename "$OUT")" ln -sfr "$OUT" "$OUTDIR/genhdr/$(basename "$OUT")"
cd "$2/micropython" cd "$2/micropython"
"$1" "$2/micropython/py/makeversionhdr.py" "$OUT" "$1" "$2/micropython/py/makeversionhdr.py" "$OUT" >/dev/null
...@@ -52,6 +52,7 @@ lib = static_library( ...@@ -52,6 +52,7 @@ lib = static_library(
'PeriphDriver', 'PeriphDriver',
sources, sources,
include_directories: includes, include_directories: includes,
c_args: '-w',
) )
periphdriver = declare_dependency( periphdriver = declare_dependency(
......
...@@ -24,6 +24,7 @@ lib = static_library( ...@@ -24,6 +24,7 @@ lib = static_library(
sources, sources,
include_directories: includes, include_directories: includes,
dependencies: periphdriver, dependencies: periphdriver,
c_args: '-w',
) )
maxusb = declare_dependency( maxusb = declare_dependency(
......
...@@ -16,6 +16,7 @@ lib = static_library( ...@@ -16,6 +16,7 @@ lib = static_library(
sources, sources,
include_directories: includes, include_directories: includes,
dependencies: periphdriver, dependencies: periphdriver,
c_args: '-w',
) )
bhy1 = declare_dependency( bhy1 = declare_dependency(
......
...@@ -6,6 +6,7 @@ lib = static_library( ...@@ -6,6 +6,7 @@ lib = static_library(
'max86150', 'max86150',
'max86150.c', 'max86150.c',
dependencies: periphdriver, dependencies: periphdriver,
c_args: '-w',
) )
max86150 = declare_dependency( max86150 = declare_dependency(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment