File tree Expand file tree Collapse file tree 3 files changed +5
-15
lines changed
examples/micro-ros_publisher Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,9 @@ rcl_timer_t timer;
2424
2525void error_loop (){
2626 while (1 ){
27- digitalWrite (LED_PIN, !digitalRead (LED_PIN));
28- delay (100 );
27+ // digitalWrite(LED_PIN, !digitalRead(LED_PIN));
28+ delay (300 );
29+ SerialUSB.println (" Error" );
2930 }
3031}
3132
@@ -82,6 +83,5 @@ void setup() {
8283}
8384
8485void loop () {
85- delay (100 );
8686 RCCHECK (rclc_executor_spin_some (&executor, RCL_MS_TO_NS (100 )));
8787}
Original file line number Diff line number Diff line change @@ -44,17 +44,7 @@ extern "C"
4444 // Place here your reading bytes platform code
4545 // Return number of bytes read (max bytes: len)
4646 (void )errcode;
47- uint32_t start_time = micros () * 1000 ;
48- size_t readed = 0 ;
49-
50- while ((readed < len) && ((micros () * 1000 ) - start_time) < (uint32_t )timeout)
51- {
52- if (SerialUSB.available ())
53- {
54- buf[readed++] = SerialUSB.read ();
55- }
56- }
57-
58- return readed;
47+ SerialUSB.setTimeout (timeout);
48+ return SerialUSB.readBytes ((char *)buf, len);
5949 }
6050}
You can’t perform that action at this time.
0 commit comments