diff --git a/libuavcan_drivers/lpc11c24/driver/src/clock.cpp b/libuavcan_drivers/lpc11c24/driver/src/clock.cpp index 7a51d1be0c..21a4dc6a3e 100644 --- a/libuavcan_drivers/lpc11c24/driver/src/clock.cpp +++ b/libuavcan_drivers/lpc11c24/driver/src/clock.cpp @@ -35,7 +35,7 @@ const int32_t MaxUtcSpeedCorrectionX16 = 100 * 16; #if __GNUC__ __attribute__((noreturn)) #endif -void fail() +static void fail() { while (true) { } } @@ -130,7 +130,7 @@ void adjustUtc(uavcan::UtcDuration adjustment) } else { - time_utc += adj_usec; + time_utc = uint64_t(int64_t(time_utc) + adj_usec); } } if (!utc_set) @@ -168,7 +168,7 @@ void SysTick_Handler() if (utc_set) { // Values below 16 are ignored - time_utc += USecPerOverflow + (utc_correction_usec_per_overflow_x16 / 16); + time_utc += uint64_t(int32_t(USecPerOverflow) + (utc_correction_usec_per_overflow_x16 / 16)); } } else diff --git a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile index 901572cf6a..8d15223f54 100644 --- a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile +++ b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile @@ -51,7 +51,8 @@ DEF += -DNDEBUG -DCHIP_LPC11CXX -DCORE_M0 -DTHUMB_NO_INTERWORKING -U__STRICT_ANS FLAGS = -mthumb -mcpu=cortex-m0 -mno-thumb-interwork -flto -Os -g3 -Wall -Wextra -Werror -ffunction-sections \ -fdata-sections -fno-common -fno-exceptions -fno-unwind-tables -fno-stack-protector -fomit-frame-pointer \ - -ftracer -ftree-loop-distribute-patterns -frename-registers -freorder-blocks -fconserve-stack + -ftracer -ftree-loop-distribute-patterns -frename-registers -freorder-blocks -fconserve-stack \ + -Wfloat-equal C_CPP_FLAGS = $(FLAGS) -MD -MP -MF $(DEPDIR)/$(@F).d diff --git a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/main.cpp b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/main.cpp index 68c7cb68af..9b38305baf 100644 --- a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/main.cpp +++ b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/main.cpp @@ -111,7 +111,7 @@ void lltoa(long long n, char buf[24]) unsigned i = 0; do { - buf[i++] = n % 10 + '0'; + buf[i++] = char(n % 10 + '0'); } while ((n /= 10) > 0); if (sign < 0) diff --git a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp index 610d923dc9..8a4125599c 100644 --- a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp +++ b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp @@ -154,6 +154,8 @@ void resetWatchdog() extern "C" { +void SystemInit(); + void SystemInit() { board::init(); diff --git a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c index 49f478619f..c0de66a51b 100644 --- a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c +++ b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c @@ -30,6 +30,17 @@ extern void SystemInit(void); #pragma GCC optimize 1 +/** + * Prototypes for the functions below + */ +void Reset_Handler(void); +void Default_Handler(void); +void NMI_Handler(void); +void HardFault_Handler(void); +void SVC_Handler(void); +void PendSV_Handler(void); +void SysTick_Handler(void); + /** * Firmware entry point */