Skip to content

Commit

Permalink
fix new warnings for new gcc, clang
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittich committed Feb 16, 2024
1 parent 703919e commit a41ff2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion common/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "FreeRTOS.h"
#include "printf.h"


#define LOG_VERSION "0.1.0_pw"

enum log_level_t { LOG_FATAL,
Expand Down
4 changes: 4 additions & 0 deletions projects/cm_mcu/CommandLineTask.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ static BaseType_t bl_ctl(int argc, char **argv, char *m)
HWREG(NVIC_DIS2) = 0xffffffff;
HWREG(NVIC_DIS3) = 0xffffffff;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"

//
// Return control to the boot loader. This is a call to the SVC
// handler in the boot loader.
//
(*((void (*)(void))(*(uint32_t *)0x2c)))();

// the above points to a memory location in flash.
#pragma GCC diagnostic pop
// shut up compiler warning. This will never get called
return pdFALSE;
}
Expand Down
4 changes: 2 additions & 2 deletions projects/cm_mcu/commands/I2CCommands.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ BaseType_t i2c_scan(int argc, char **argv, char *m)
copied += snprintf(m + copied, SCRATCH_SIZE - copied,
" 0 1 2 3 4 5 6 7 8 9 a b c d e f\r\n00: ");
for (uint8_t i = 0x3; i < 0x78; ++i) {
uint8_t data;
uint8_t data[4];
if (i % 16 == 0) {
copied += snprintf(m + copied, SCRATCH_SIZE - copied, "\r\n%2x:", i);
}
// try to read one byte from current address
int status = apollo_i2c_ctl_r(device, i, 1, &data);
int status = apollo_i2c_ctl_r(device, i, 1, data);
if (status == 0)
copied += snprintf(m + copied, SCRATCH_SIZE - copied, " %2x", i);
else
Expand Down

0 comments on commit a41ff2d

Please sign in to comment.