File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,16 @@ void BoschSensorClass::onInterrupt(mbed::Callback<void(void)> cb)
3939 irq.rise (mbed::callback (this , &BoschSensorClass::interrupt_handler));
4040}
4141#endif
42+ #ifdef ARDUINO_ARCH_ESP32
43+ void BoschSensorClass::onInterrupt (void (*cb)(void ))
44+ {
45+ if (BMI270_INT1 == -1 ) {
46+ return ;
47+ }
48+ pinMode (BMI270_INT1, INPUT_PULLUP);
49+ attachInterrupt (BMI270_INT1, cb, FALLING);
50+ }
51+ #endif
4252int BoschSensorClass::begin (CfgBoshSensor_t cfg) {
4353
4454 _wire->begin ();
Original file line number Diff line number Diff line change @@ -150,6 +150,17 @@ class BoschSensorClass {
150150 }
151151 PinName BMI270_INT1 = NC;
152152 #endif
153+ #ifdef ARDUINO_ARCH_ESP32
154+ void onInterrupt (void (*)(void ));
155+ void setInterruptPin (int irq_pin) {
156+ BMI270_INT1 = irq_pin;
157+ }
158+ #if defined(ARDUINO_ARDUINO_NESSO_N1)
159+ int BMI270_INT1 = 3 ;
160+ #else
161+ int BMI270_INT1 = -1 ;
162+ #endif
163+ #endif
153164 // Accelerometer
154165 virtual int readAcceleration (float & x, float & y, float & z); // Results are in G (earth gravity).
155166 virtual int accelerationAvailable (); // Number of samples in the FIFO.
You can’t perform that action at this time.
0 commit comments