Browse Source

AP_HAL_AVR: fixed interrupt attach for MPU6000

master
Andrew Tridgell 12 years ago
parent
commit
857c0b69e5
  1. 2
      libraries/AP_HAL_AVR/GPIO.cpp

2
libraries/AP_HAL_AVR/GPIO.cpp

@ -93,7 +93,7 @@ void AVRGPIO::write(uint8_t pin, uint8_t value) {
/* Implement GPIO Interrupt 6, used for MPU6000 data ready on APM2. */ /* Implement GPIO Interrupt 6, used for MPU6000 data ready on APM2. */
bool AVRGPIO::attach_interrupt( bool AVRGPIO::attach_interrupt(
uint8_t interrupt_num, AP_HAL::Proc proc, uint8_t mode) { uint8_t interrupt_num, AP_HAL::Proc proc, uint8_t mode) {
if (!((mode == 0)||(mode == 1))) return false; if (!((mode == 0)||(mode == 1)||(mode==3))) return false;
if (interrupt_num == 6) { if (interrupt_num == 6) {
_interrupt_6 = proc; _interrupt_6 = proc;
EICRB = (EICRB & ~((1 << ISC60) | (1 << ISC61))) | (mode << ISC60); EICRB = (EICRB & ~((1 << ISC60) | (1 << ISC61))) | (mode << ISC60);

Loading…
Cancel
Save