Fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7.1.0

BMP280: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

gnss: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

fmu: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

timer.c: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

px4cannode_led: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

Fix -Werror=implicit-fallthrough on gcc7
This commit is contained in:
Julien Lecoeur 2017-07-04 18:50:00 +02:00 committed by Beat Küng
parent d477b1f0f4
commit abcb920df4
7 changed files with 23 additions and 5 deletions

View File

@ -358,9 +358,12 @@ BMP280::ioctl(struct file *filp, int cmd, unsigned long arg)
return -EINVAL;
case SENSOR_POLLRATE_MAX:
/* FALLTHROUGH */
case SENSOR_POLLRATE_DEFAULT:
ticks = _max_mesure_ticks;
/* FALLTHROUGH */
default: {
if (ticks == 0) {
ticks = USEC2TICK(USEC_PER_SEC / arg);

View File

@ -158,7 +158,7 @@ __EXPORT void board_autoled_off(int led)
case LED_STACKCREATED:
phy_set_led(BOARD_LED_GREEN, false);
// no break
/* FALLTHROUGH */
case LED_INIRQ:
case LED_SIGNAL:

View File

@ -220,7 +220,8 @@ void __wrap_sched_process_timer(void)
case Repeating:
timers[t].count = timers[t].reload;
/* fall through to callback */
/* FALLTHROUGH */
/* to callback */
case Timeout:
if (timers[t].usr.cb) {
timers[t].usr.cb(t, timers[t].usr.context);

View File

@ -464,6 +464,8 @@ static int frsky_telemetry_thread_main(int argc, char *argv[])
}
/* FALLTHROUGH */
case SMARTPORT_POLL_8:
/* report nav_state as DIY_NAVSTATE 2Hz */

View File

@ -1357,7 +1357,8 @@ ms5611_main(int argc, char *argv[])
}
}
//no break
/* FALLTHROUGH */
default:
ms5611::usage();
exit(0);

View File

@ -653,9 +653,10 @@ PX4FMU::set_mode(Mode mode)
up_input_capture_set(2, Rising, 0, NULL, NULL);
up_input_capture_set(3, Rising, 0, NULL, NULL);
DEVICE_DEBUG("MODE_2PWM2CAP");
// no break
#endif
/* FALLTHROUGH */
case MODE_2PWM: // v1 multi-port with flow control lines as PWM
DEVICE_DEBUG("MODE_2PWM");
@ -674,9 +675,10 @@ PX4FMU::set_mode(Mode mode)
case MODE_3PWM1CAP: // v1 multi-port with flow control lines as PWM
DEVICE_DEBUG("MODE_3PWM1CAP");
up_input_capture_set(3, Rising, 0, NULL, NULL);
// no break
#endif
/* FALLTHROUGH */
case MODE_3PWM: // v1 multi-port with flow control lines as PWM
DEVICE_DEBUG("MODE_3PWM");
@ -2179,6 +2181,8 @@ PX4FMU::pwm_ioctl(file *filp, int cmd, unsigned long arg)
#if defined(BOARD_HAS_PWM) && BOARD_HAS_PWM >= 8
case PWM_SERVO_SET(7):
/* FALLTHROUGH */
case PWM_SERVO_SET(6):
if (_mode < MODE_8PWM) {
ret = -EINVAL;
@ -2189,7 +2193,10 @@ PX4FMU::pwm_ioctl(file *filp, int cmd, unsigned long arg)
#if defined(BOARD_HAS_PWM) && BOARD_HAS_PWM >= 6
/* FALLTHROUGH */
case PWM_SERVO_SET(5):
/* FALLTHROUGH */
case PWM_SERVO_SET(4):
if (_mode < MODE_6PWM) {
ret = -EINVAL;
@ -2226,6 +2233,7 @@ PX4FMU::pwm_ioctl(file *filp, int cmd, unsigned long arg)
#if defined(BOARD_HAS_PWM) && BOARD_HAS_PWM >= 8
/* FALLTHROUGH */
case PWM_SERVO_GET(7):
case PWM_SERVO_GET(6):
if (_mode < MODE_8PWM) {
@ -2237,6 +2245,7 @@ PX4FMU::pwm_ioctl(file *filp, int cmd, unsigned long arg)
#if defined(BOARD_HAS_PWM) && BOARD_HAS_PWM >= 6
/* FALLTHROUGH */
case PWM_SERVO_GET(5):
case PWM_SERVO_GET(4):
if (_mode < MODE_6PWM) {

View File

@ -189,6 +189,7 @@ void UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavc
vel_cov[7] = msg.covariance[19];
vel_cov[8] = msg.covariance[20];
}
/* FALLTHROUGH */
// Full matrix 6x6.
// This code has been carefully optimized by hand. We could use unpackSquareMatrix(), but it's slow.
@ -220,6 +221,7 @@ void UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavc
vel_cov[7] = msg.covariance[34];
vel_cov[8] = msg.covariance[35];
}
/* FALLTHROUGH */
// Either empty or invalid sized, interpret as zero matrix
default: {