Skip to content
Prev Previous commit
Next Next commit
Remove unreachable code
IAR generates warning Pe111 'statement is unreachable'. GCC doesn't
complain about their absence, if they are removed.
  • Loading branch information
Ben Avison committed Sep 13, 2022
commit a3dbe5656337219bca3169e97211d484fcd8e8f9
2 changes: 0 additions & 2 deletions adc/microphone_adc/microphone_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,4 @@ int main() {
printf("%.2f\n", adc_raw * ADC_CONVERT);
sleep_ms(10);
}

return 0;
}
2 changes: 0 additions & 2 deletions adc/onboard_temperature/onboard_temperature.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,4 @@ int main() {
#endif
sleep_ms(990);
}

return 0;
}
2 changes: 0 additions & 2 deletions gpio/hello_7segment/hello_7segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,5 @@ int main() {
sleep_ms(250);
gpio_clr_mask(mask);
}

return 0;
}
/// \end::hello_gpio[]
2 changes: 0 additions & 2 deletions gpio/hello_gpio_irq/hello_gpio_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ int main() {

// Wait forever
while (1);

return 0;
}


Expand Down
1 change: 0 additions & 1 deletion hello_world/serial/hello_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ int main() {
printf("Hello, world!\n");
sleep_ms(1000);
}
return 0;
}
1 change: 0 additions & 1 deletion hello_world/usb/hello_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ int main() {
printf("Hello, world!\n");
sleep_ms(1000);
}
return 0;
}
3 changes: 1 addition & 2 deletions i2c/bmp280_i2c/bmp280_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ int main() {
#if !defined(i2c_default) || !defined(PICO_DEFAULT_I2C_SDA_PIN) || !defined(PICO_DEFAULT_I2C_SCL_PIN)
#warning i2c / bmp280_i2c example requires a board with I2C pins
puts("Default I2C pins were not defined");
return 0;
#else
// useful information for picotool
bi_decl(bi_2pins_with_func(PICO_DEFAULT_I2C_SDA_PIN, PICO_DEFAULT_I2C_SCL_PIN, GPIO_FUNC_I2C));
Expand Down Expand Up @@ -248,7 +249,5 @@ int main() {
// poll every 500ms
sleep_ms(500);
}

#endif
return 0;
}
2 changes: 0 additions & 2 deletions i2c/lcd_1602_i2c/lcd_1602_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,5 @@ int main() {
lcd_clear();
}
}

return 0;
#endif
}
1 change: 0 additions & 1 deletion i2c/lis3dh_i2c/lis3dh_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,4 @@ int main() {
printf("\e[1;1H\e[2J");
}
#endif
return 0;
}
2 changes: 1 addition & 1 deletion i2c/mpl3115a2_i2c/mpl3115a2_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ int main() {
#if !defined(i2c_default) || !defined(PICO_DEFAULT_I2C_SDA_PIN) || !defined(PICO_DEFAULT_I2C_SCL_PIN)
#warning i2c / mpl3115a2_i2c example requires a board with I2C pins
puts("Default I2C pins were not defined");
return 0;
#else
printf("Hello, MPL3115A2. Waiting for something to interrupt me!...\n");

Expand Down Expand Up @@ -202,5 +203,4 @@ int main() {
};

#endif
return 0;
}
3 changes: 1 addition & 2 deletions i2c/mpu6050_i2c/mpu6050_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ int main() {
#if !defined(i2c_default) || !defined(PICO_DEFAULT_I2C_SDA_PIN) || !defined(PICO_DEFAULT_I2C_SCL_PIN)
#warning i2c/mpu6050_i2c example requires a board with I2C pins
puts("Default I2C pins were not defined");
return 0;
#else
printf("Hello, MPU6050! Reading raw data from registers...\n");

Expand Down Expand Up @@ -111,7 +112,5 @@ int main() {

sleep_ms(100);
}

#endif
return 0;
}
1 change: 0 additions & 1 deletion i2c/pa1010d_i2c/pa1010d_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,4 @@ int main() {
printf("\e[1;1H\e[2J");
}
#endif
return 0;
}
1 change: 0 additions & 1 deletion i2c/pcf8523_i2c/pcf8523_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,5 @@ int main() {
printf("\e[1;1H\e[2J");
}
#endif
return 0;
}

2 changes: 0 additions & 2 deletions rtc/hello_rtc/hello_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,5 @@ int main() {
printf("\r%s ", datetime_str);
sleep_ms(100);
}

return 0;
}
/// \end::hello_rtc_main[]
2 changes: 0 additions & 2 deletions rtc/rtc_alarm_repeat/rtc_alarm_repeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,4 @@ int main() {

// Alarm will keep firing forever
while(1);

return 0;
}
2 changes: 0 additions & 2 deletions spi/bme280_spi/bme280_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,5 @@ int main() {

sleep_ms(1000);
}

return 0;
#endif
}
2 changes: 0 additions & 2 deletions spi/max7219_32x8_spi/max7219_32x8_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,5 @@ int main() {

bright++;
}

return 0;
#endif
}
2 changes: 0 additions & 2 deletions spi/max7219_8x7seg_spi/max7219_8x7seg_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,5 @@ int main() {
j = 0;
}
}

return 0;
#endif
}
2 changes: 0 additions & 2 deletions spi/mpu9250_spi/mpu9250_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,4 @@ int main() {

sleep_ms(100);
}

return 0;
}
2 changes: 0 additions & 2 deletions usb/device/dev_hid_composite/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ int main(void)

hid_task();
}

return 0;
}

//--------------------------------------------------------------------+
Expand Down
2 changes: 0 additions & 2 deletions usb/device/dev_lowlevel/dev_lowlevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,4 @@ int main(void) {
while (1) {
tight_loop_contents();
}

return 0;
}
2 changes: 0 additions & 2 deletions usb/host/host_cdc_msc_hid/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ int main(void)
hid_app_task();
#endif
}

return 0;
}

//--------------------------------------------------------------------+
Expand Down