Skip to content

Commit 9e30418

Browse files
committedJun 6, 2024
Fixed due to esp32 package 3.0.1 update
1 parent deee261 commit 9e30418

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+204
-214
lines changed
 

‎uROS_STEP10_tfMsg/interrupt.ino‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 RT Corporation
1+
// Copyright 2024 RT Corporation
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

‎uROS_STEP10_tfMsg/uROS_STEP10_tfMsg.ino‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 RT Corporation
1+
// Copyright 2024 RT Corporation
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -136,7 +136,7 @@ void IRAM_ATTR isrR(void)
136136
portENTER_CRITICAL_ISR(&g_timer_mux); //割り込み禁止
137137
if (g_motor_move) {
138138
if (g_step_hz_r < 30) g_step_hz_r = 30;
139-
timerAlarmWrite(g_timer2, 2000000 / g_step_hz_r, true);
139+
timerAlarm(g_timer2, 2000000 / g_step_hz_r, true, 0);
140140
digitalWrite(PWM_R, HIGH);
141141
for (int i = 0; i < 100; i++) {
142142
asm("nop \n");
@@ -153,7 +153,7 @@ void IRAM_ATTR isrL(void)
153153
portENTER_CRITICAL_ISR(&g_timer_mux); //割り込み禁止
154154
if (g_motor_move) {
155155
if (g_step_hz_l < 30) g_step_hz_l = 30;
156-
timerAlarmWrite(g_timer3, 2000000 / g_step_hz_l, true);
156+
timerAlarm(g_timer3, 2000000 / g_step_hz_l, true, 0);
157157
digitalWrite(PWM_L, HIGH);
158158
for (int i = 0; i < 100; i++) {
159159
asm("nop \n");
@@ -201,20 +201,20 @@ void setup()
201201

202202
delay(2000);
203203

204-
g_timer0 = timerBegin(0, 80, true); //1us
205-
timerAttachInterrupt(g_timer0, &onTimer0, true);
206-
timerAlarmWrite(g_timer0, 1000, true); //1kHz
207-
timerAlarmEnable(g_timer0);
204+
g_timer0 = timerBegin(1000000); //1us
205+
timerAttachInterrupt(g_timer0, &onTimer0);
206+
timerAlarm(g_timer0, 1000, true, 0); //1kHz
207+
timerStart(g_timer0);
208208

209-
g_timer2 = timerBegin(2, 40, true); //0.5us
210-
timerAttachInterrupt(g_timer2, &isrR, true);
211-
timerAlarmWrite(g_timer2, 13333, true); //150Hz
212-
timerAlarmEnable(g_timer2);
209+
g_timer2 = timerBegin(2000000); //0.5us
210+
timerAttachInterrupt(g_timer2, &isrR);
211+
timerAlarm(g_timer2, 13333, true, 0); //150Hz
212+
timerStart(g_timer2);
213213

214-
g_timer3 = timerBegin(3, 40, true); //0.5us
215-
timerAttachInterrupt(g_timer3, &isrL, true);
216-
timerAlarmWrite(g_timer3, 13333, true); //150Hz
217-
timerAlarmEnable(g_timer3);
214+
g_timer3 = timerBegin(2000000); //0.5us
215+
timerAttachInterrupt(g_timer3, &isrL);
216+
timerAlarm(g_timer3, 13333, true, 0); //150Hz
217+
timerStart(g_timer3);
218218

219219
g_allocator = rcl_get_default_allocator();
220220

0 commit comments

Comments
 (0)
Please sign in to comment.