diff --git a/apps/talker_stm32_timer/talker_stm32_timer.c b/apps/talker_stm32_timer/talker_stm32_timer.c index 6c63148..4f968bd 100644 --- a/apps/talker_stm32_timer/talker_stm32_timer.c +++ b/apps/talker_stm32_timer/talker_stm32_timer.c @@ -11,7 +11,7 @@ void tim5_vector(void) return; static char __attribute__((aligned(4))) msg[256] = {0}; static int pub_count = 0; - snprintf(&msg[4], sizeof(msg), "Hello World: %d", pub_count++); + snprintf(&msg[4], (sizeof(msg) - 4), "Hello World: %d", pub_count++); uint32_t rtps_string_len = strlen(&msg[4]) + 1; *((uint32_t *)msg) = rtps_string_len; freertps_publish(g_pub, (uint8_t *)msg, rtps_string_len + 4); diff --git a/systems/samv71_xplained_ultra-metal/pin.c b/systems/samv71_xplained_ultra-metal/pin.c index f31594f..0809831 100644 --- a/systems/samv71_xplained_ultra-metal/pin.c +++ b/systems/samv71_xplained_ultra-metal/pin.c @@ -26,8 +26,8 @@ void pin_set_mux(Pio *pio, const unsigned pin_idx, pio->PIO_ABCDSR[0] &= ~pin_mask; pio->PIO_ABCDSR[1] &= ~pin_mask; // now , set the necessary bits - pio->PIO_ABCDSR[0] |= mux_idx & 0x1 ? pin_mask : 0; - pio->PIO_ABCDSR[1] |= mux_idx & 0x2 ? pin_mask : 0; + pio->PIO_ABCDSR[0] |= (mux_idx & 0x1) ? pin_mask : 0; + pio->PIO_ABCDSR[1] |= (mux_idx & 0x2) ? pin_mask : 0; // and disable GPIO control of pin (that is, let the peripheral mux have it) pio->PIO_PDR = pin_mask; } diff --git a/udp.c b/udp.c index b2f8b8a..04747da 100644 --- a/udp.c +++ b/udp.c @@ -174,8 +174,8 @@ static bool frudp_rx_heartbeat(RX_MSG_ARGS) frudp_print_guid(&writer_guid); printf(" => 0x%08x %d -> %d\n", (unsigned)freertps_htonl(hb->reader_id.u), - (unsigned)hb->first_sn.low, - (unsigned)hb->last_sn.low); + (int)hb->first_sn.low, + (int)hb->last_sn.low); #endif //frudp_print_readers(); diff --git a/utils/lightweightserial.cpp b/utils/lightweightserial.cpp index b866d50..7c76708 100644 --- a/utils/lightweightserial.cpp +++ b/utils/lightweightserial.cpp @@ -89,7 +89,7 @@ LightweightSerial::LightweightSerial(const char *port, int baud) : // flush the buffer of the serial device uint8_t b; - while (this->read(&b) > 0) { } + while (this->read(&b)) { } happy = true; }