File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -917,26 +917,25 @@ zaf_event_distributor_app_proprietary(event_nc_t *event)
917917 bTiltDetected = true;
918918 }
919919
920- // Send a gyro measurement whenever the user requests it
921- // or the orientation has just stabilized
922- if (bRequestGyroMeasurement || stable_gyro_readings == 7 ) {
923- bRequestGyroMeasurement = false;
924-
925- uint8_t cmd [8 ];
926- uint8_t i = 0 ;
927- cmd [i ++ ] = NABU_CASA_GYRO_MEASURE ;
928- cmd [i ++ ] = gyro_reading .x >> 8 ;
929- cmd [i ++ ] = gyro_reading .x & 0xFF ;
930- cmd [i ++ ] = gyro_reading .y >> 8 ;
931- cmd [i ++ ] = gyro_reading .y & 0xFF ;
932- cmd [i ++ ] = gyro_reading .z >> 8 ;
933- cmd [i ++ ] = gyro_reading .z & 0xFF ;
934- RequestUnsolicited (
935- FUNC_ID_NABU_CASA ,
936- cmd ,
937- i
938- );
920+ if (!bRequestGyroMeasurement ) {
921+ return ;
939922 }
923+ bRequestGyroMeasurement = false;
924+
925+ uint8_t cmd [8 ];
926+ uint8_t i = 0 ;
927+ cmd [i ++ ] = NABU_CASA_GYRO_MEASURE ;
928+ cmd [i ++ ] = gyro_reading .x >> 8 ;
929+ cmd [i ++ ] = gyro_reading .x & 0xFF ;
930+ cmd [i ++ ] = gyro_reading .y >> 8 ;
931+ cmd [i ++ ] = gyro_reading .y & 0xFF ;
932+ cmd [i ++ ] = gyro_reading .z >> 8 ;
933+ cmd [i ++ ] = gyro_reading .z & 0xFF ;
934+ RequestUnsolicited (
935+ FUNC_ID_NABU_CASA ,
936+ cmd ,
937+ i
938+ );
940939 break ;
941940 }
942941
You can’t perform that action at this time.
0 commit comments