Optimizations
This commit is contained in:
parent
2d0261c3bb
commit
f5db4cb95d
18
main.c
18
main.c
@ -372,14 +372,14 @@ ISR(TIMER1_OVF_vect) {
|
||||
}
|
||||
}
|
||||
|
||||
// без скорости
|
||||
if (exec == 1) {
|
||||
if (exec > 0) {
|
||||
exec = -1;
|
||||
MCUCR &= ~(1 << SE);
|
||||
sei();
|
||||
read_sensors();
|
||||
// если измерений 6 (и мало ли больше), то отправляем смс
|
||||
if (sensor_measurements >= MEASUREMENTS) {
|
||||
// если под скоростью, то тоже отправляем смс
|
||||
if (exec == 2 || sensor_measurements >= MEASUREMENTS) {
|
||||
try_to_send_telemetry();
|
||||
}
|
||||
|
||||
@ -387,16 +387,4 @@ ISR(TIMER1_OVF_vect) {
|
||||
MCUCR |= (1 << SE);
|
||||
exec = 0;
|
||||
}
|
||||
|
||||
// под скоростью
|
||||
if (exec == 2) {
|
||||
exec = -1;
|
||||
MCUCR &= ~(1 << SE);
|
||||
sei();
|
||||
read_sensors();
|
||||
try_to_send_telemetry();
|
||||
cli();
|
||||
MCUCR |= (1 << SE);
|
||||
exec = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user