cleanup: Fix more spourious missing return warnings

Rewrite to use a temporary and get rid of the warning.
The generated asm is *unchanged*.
This commit is contained in:
Yuri D'Elia 2022-10-03 21:54:08 +02:00
parent 992845198d
commit 5ed6bd7f8b
1 changed files with 3 additions and 1 deletions

View File

@ -466,7 +466,9 @@ void PAT9125_sensor::settings_init() {
}
int16_t PAT9125_sensor::getStepCount() {
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { return stepCount; }
int16_t ret;
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; }
return ret;
}
void PAT9125_sensor::resetStepCount() {