diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp index 9d72cf0241..06399d3947 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp @@ -142,20 +142,26 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v //u8g->pin_list[U8G_PI_SET_A0] = 1; //if (u8g_com_arduino_ssd_start_sequence(u8g) == 0) // return u8g_i2c_stop(), 0; - if (u8g_i2c_send_byte(arg_val) == 0) - return u8g_i2c_stop(), 0; + if (u8g_i2c_send_byte(arg_val) == 0) { + u8g_i2c_stop(); + return 0; + } // u8g_i2c_stop(); break; case U8G_COM_MSG_WRITE_SEQ: { - //u8g->pin_list[U8G_PI_SET_A0] = 1; - if (u8g_com_ssd_I2C_start_sequence(u8g) == 0) - return u8g_i2c_stop(), 0; + //u8g->pin_list[U8G_PI_SET_A0] = 1; + if (u8g_com_ssd_I2C_start_sequence(u8g) == 0) { + u8g_i2c_stop(); + return 0; + } register uint8_t *ptr = (uint8_t *)arg_ptr; while (arg_val > 0) { - if (u8g_i2c_send_byte(*ptr++) == 0) - return u8g_i2c_stop(), 0; + if (u8g_i2c_send_byte(*ptr++) == 0) { + u8g_i2c_stop(); + return 0; + } arg_val--; } } @@ -164,8 +170,10 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v case U8G_COM_MSG_WRITE_SEQ_P: { //u8g->pin_list[U8G_PI_SET_A0] = 1; - if (u8g_com_ssd_I2C_start_sequence(u8g) == 0) - return u8g_i2c_stop(), 0; + if (u8g_com_ssd_I2C_start_sequence(u8g) == 0) { + u8g_i2c_stop(); + return 0; + } register uint8_t *ptr = (uint8_t *)arg_ptr; while (arg_val > 0) { diff --git a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp b/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp index b903cac267..c61fa4a8ce 100644 --- a/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/u8g_com_HAL_LPC1768_st7920_hw_spi.cpp @@ -79,7 +79,6 @@ void spiSend(const uint8_t* buf, size_t n); static uint8_t rs_last_state = 255; static void u8g_com_LPC1768_st7920_write_byte_hw_spi(uint8_t rs, uint8_t val) { - uint8_t i; if ( rs != rs_last_state) { // time to send a command/data byte rs_last_state = rs; diff --git a/Marlin/src/backtrace/unwarm_thumb.cpp b/Marlin/src/backtrace/unwarm_thumb.cpp index d3f68be8b7..33e14f15cf 100644 --- a/Marlin/src/backtrace/unwarm_thumb.cpp +++ b/Marlin/src/backtrace/unwarm_thumb.cpp @@ -255,10 +255,9 @@ UnwResult UnwStartThumb(UnwState * const state) { * the switch clauses */ uint8_t rn = instr & 0xF; - uint8_t rm = instr2 & 0xF; bool H = (instr2 & 0x10) ? true : false; - UnwPrintd5("TB%c [r%d,r%d%s]\n", H ? 'H' : 'B', rn, rm, H ? ",LSL #1" : ""); + UnwPrintd5("TB%c [r%d,r%d%s]\n", H ? 'H' : 'B', rn, (instr2 & 0xF), H ? ",LSL #1" : ""); // We are only interested if the RN is the PC. Let's choose the 1st destination if (rn == 15) { diff --git a/Marlin/src/backtrace/unwarmbytab.cpp b/Marlin/src/backtrace/unwarmbytab.cpp index ec8a9a066c..4c083fd097 100644 --- a/Marlin/src/backtrace/unwarmbytab.cpp +++ b/Marlin/src/backtrace/unwarmbytab.cpp @@ -185,7 +185,7 @@ static UnwResult UnwTabExecuteInstructions(const UnwindCallbacks *cb, UnwTabStat /* pop r4-r[4+nnn] or pop r4-r[4+nnn], r14*/ vsp = ucb->vrs[13]; - for (reg = 4; reg <= (instruction & 0x07) + 4; ++reg) { + for (reg = 4; reg <= uint32_t((instruction & 0x07) + 4); ++reg) { uint32_t v; if (!cb->readW(vsp,&v)) return UNWIND_DREAD_W_FAIL;