Skip to content

Commit cd62d1a

Browse files
committed
Fix warnings
1 parent 7eb5a26 commit cd62d1a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Braccio.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
#error Please use lvgl >= 8.1
77
#endif
88

9+
#include "mbed.h"
10+
911
void my_print( const char * dsc )
1012
{
1113
Serial.println(dsc);
1214
}
1315

16+
using namespace std::chrono_literals;
17+
1418
bool BraccioClass::begin(voidFuncPtr customMenu) {
1519

1620
Wire.begin();
@@ -22,7 +26,7 @@ bool BraccioClass::begin(voidFuncPtr customMenu) {
2226
static rtos::Thread th(osPriorityHigh);
2327
th.start(mbed::callback(this, &BraccioClass::pd_thread));
2428
attachInterrupt(PIN_FUSB302_INT, mbed::callback(this, &BraccioClass::unlock_pd_semaphore_irq), FALLING);
25-
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 0.01f);
29+
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 10ms);
2630
#endif
2731

2832
PD_UFP.init_PPS(PPS_V(7.2), PPS_A(2.0));
@@ -139,6 +143,8 @@ bool BraccioClass::begin(voidFuncPtr customMenu) {
139143
static rtos::Thread connected_th;
140144
connected_th.start(mbed::callback(this, &BraccioClass::motors_connected_thread));
141145
#endif
146+
147+
return true;
142148
}
143149

144150
void BraccioClass::connectJoystickTo(lv_obj_t* obj) {
@@ -152,11 +158,11 @@ void BraccioClass::pd_thread() {
152158
auto ret = pd_events.wait_any(0xFF);
153159
if ((ret & 1) && (millis() - start_pd_burst > 1000)) {
154160
pd_timer.detach();
155-
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 1.0f);
161+
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 1s);
156162
}
157163
if (ret & 2) {
158164
pd_timer.detach();
159-
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 0.05f);
165+
pd_timer.attach(mbed::callback(this, &BraccioClass::unlock_pd_semaphore), 50ms);
160166
}
161167
i2c_mutex.lock();
162168
PD_UFP.run();

0 commit comments

Comments
 (0)