fixed bug - fsensor synchronization (b146)

This commit is contained in:
Robert Pelnar 2018-01-15 15:23:06 +01:00
parent 9aedaa8fe7
commit aaf4e0a5e0
1 changed files with 3 additions and 2 deletions

View File

@ -153,11 +153,12 @@ bool fsensor_check_autoload(void)
ISR(PCINT2_vect) ISR(PCINT2_vect)
{ {
// puts("PCINT2\n");
if (!((fsensor_int_pin_old ^ PINK) & FSENSOR_INT_PIN_MSK)) return; if (!((fsensor_int_pin_old ^ PINK) & FSENSOR_INT_PIN_MSK)) return;
fsensor_int_pin_old = PINK;
static bool _lock = false; static bool _lock = false;
if (_lock) return; if (_lock) return;
_lock = true; _lock = true;
// puts("PCINT2\n");
// return; // return;
int st_cnt = fsensor_st_cnt; int st_cnt = fsensor_st_cnt;
fsensor_st_cnt = 0; fsensor_st_cnt = 0;
@ -219,7 +220,7 @@ ISR(PCINT2_vect)
} }
} }
pat9125_y = 0; pat9125_y = 0;
_lock = true; _lock = false;
return; return;
} }