@@ -22,6 +22,8 @@ extern "C"
22
22
{
23
23
void braccio_disp_flush (lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
24
24
void braccio_read_keypad (lv_indev_drv_t * indev, lv_indev_data_t * data);
25
+ void braccio_unlock_pd_semaphore_irq ();
26
+ void braccio_unlock_pd_semaphore ();
25
27
};
26
28
27
29
/* *************************************************************************************
@@ -74,8 +76,8 @@ bool BraccioClass::begin(voidFuncPtr custom_menu)
74
76
75
77
static rtos::Thread th (osPriorityHigh);
76
78
th.start (mbed::callback (this , &BraccioClass::pd_thread));
77
- attachInterrupt (PIN_FUSB302_INT, mbed::callback ( this , &BraccioClass::unlock_pd_semaphore_irq) , FALLING);
78
- _pd_timer.attach (mbed::callback ( this , &BraccioClass::unlock_pd_semaphore) , 10ms);
79
+ attachInterrupt (PIN_FUSB302_INT, braccio_unlock_pd_semaphore_irq , FALLING);
80
+ _pd_timer.attach (braccio_unlock_pd_semaphore , 10ms);
79
81
80
82
_PD_UFP.init_PPS (PPS_V (7.2 ), PPS_A (2.0 ));
81
83
@@ -435,11 +437,11 @@ void BraccioClass::pd_thread() {
435
437
auto ret = _pd_events.wait_any (0xFF );
436
438
if ((ret & 1 ) && (millis () - start_pd_burst > 1000 )) {
437
439
_pd_timer.detach ();
438
- _pd_timer.attach (mbed::callback ( this , &BraccioClass::unlock_pd_semaphore) , 5s);
440
+ _pd_timer.attach (braccio_unlock_pd_semaphore , 5s);
439
441
}
440
442
if (ret & 2 ) {
441
443
_pd_timer.detach ();
442
- _pd_timer.attach (mbed::callback ( this , &BraccioClass::unlock_pd_semaphore) , 50ms);
444
+ _pd_timer.attach (braccio_unlock_pd_semaphore , 50ms);
443
445
}
444
446
_i2c_mtx.lock ();
445
447
if (millis () - last_time_ask_pps > 5000 ) {
@@ -510,3 +512,13 @@ extern "C" void braccio_read_keypad(lv_indev_drv_t * drv, lv_indev_data_t* data)
510
512
511
513
data->key = last_key;
512
514
}
515
+
516
+ void braccio_unlock_pd_semaphore_irq ()
517
+ {
518
+ Braccio.unlock_pd_semaphore_irq ();
519
+ }
520
+
521
+ void braccio_unlock_pd_semaphore ()
522
+ {
523
+ Braccio.unlock_pd_semaphore ();
524
+ }
0 commit comments