LPC11C24 warning fixes

This commit is contained in:
Pavel Kirienko 2014-08-28 17:43:12 +04:00
parent 8a8bb78d38
commit 0bfd5a95df
5 changed files with 19 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -154,6 +154,8 @@ void resetWatchdog()
extern "C"
{
void SystemInit();
void SystemInit()
{
board::init();

View File

@ -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
*/