Skip to content

Commit 9e30418

Browse files
committed
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

uROS_STEP11_SensorMsg/uROS_STEP11_SensorMsg.ino

Lines changed: 5 additions & 5 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.
@@ -163,10 +163,10 @@ void setup()
163163

164164
delay(2000);
165165

166-
g_timer1 = timerBegin(1, 80, true); //1us
167-
timerAttachInterrupt(g_timer1, &onTimer1, true);
168-
timerAlarmWrite(g_timer1, 250, true); //4kHz
169-
timerAlarmEnable(g_timer1);
166+
g_timer1 = timerBegin(1000000); //1us
167+
timerAttachInterrupt(g_timer1, &onTimer1);
168+
timerAlarm(g_timer1, 250, true, 0); //4kHz
169+
timerStart(g_timer1);
170170

171171
g_allocator = rcl_get_default_allocator();
172172

uROS_STEP12_micromouse/SPIFFS.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_STEP12_micromouse/adjust.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_STEP12_micromouse/device.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,5 @@
3636
#define SW_CM 2
3737
#define SW_RM 4
3838

39-
#define BUZZER_CH 0
4039

4140
#endif // DEVICE_H_

uROS_STEP12_micromouse/device.ino

Lines changed: 35 additions & 40 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.
@@ -60,7 +60,7 @@ void IRAM_ATTR isrR(void)
6060
portENTER_CRITICAL_ISR(&g_timer_mux);
6161
if (g_motor_move) {
6262
if (g_step_hz_r < 30) g_step_hz_r = 30;
63-
timerAlarmWrite(g_timer2, 2000000 / g_step_hz_r, true);
63+
timerAlarm(g_timer2, 2000000 / g_step_hz_r, true, 0);
6464
digitalWrite(PWM_R, HIGH);
6565
for (int i = 0; i < 100; i++) {
6666
asm("nop \n");
@@ -76,7 +76,7 @@ void IRAM_ATTR isrL(void)
7676
portENTER_CRITICAL_ISR(&g_timer_mux);
7777
if (g_motor_move) {
7878
if (g_step_hz_l < 30) g_step_hz_l = 30;
79-
timerAlarmWrite(g_timer3, 2000000 / g_step_hz_l, true);
79+
timerAlarm(g_timer3, 2000000 / g_step_hz_l, true, 0);
8080
digitalWrite(PWM_L, HIGH);
8181
for (int i = 0; i < 100; i++) {
8282
asm("nop \n");
@@ -87,21 +87,21 @@ void IRAM_ATTR isrL(void)
8787
portEXIT_CRITICAL_ISR(&g_timer_mux);
8888
}
8989

90-
void controlInterruptStart(void) { timerAlarmEnable(g_timer0); }
91-
void controlInterruptStop(void) { timerAlarmDisable(g_timer0); }
90+
void controlInterruptStart(void) { timerStart(g_timer0); }
91+
void controlInterruptStop(void) { timerStop(g_timer0); }
9292

93-
void sensorInterruptStart(void) { timerAlarmEnable(g_timer1); }
94-
void sensorInterruptStop(void) { timerAlarmDisable(g_timer1); }
93+
void sensorInterruptStart(void) { timerStart(g_timer1); }
94+
void sensorInterruptStop(void) { timerStop(g_timer1); }
9595

9696
void PWMInterruptStart(void)
9797
{
98-
timerAlarmEnable(g_timer2);
99-
timerAlarmEnable(g_timer3);
98+
timerStart(g_timer2);
99+
timerStart(g_timer3);
100100
}
101101
void PWMInterruptStop(void)
102102
{
103-
timerAlarmDisable(g_timer2);
104-
timerAlarmDisable(g_timer3);
103+
timerStop(g_timer2);
104+
timerStop(g_timer3);
105105
}
106106

107107
void initDevice(void)
@@ -118,9 +118,8 @@ void initDevice(void)
118118
pinMode(SW_C, INPUT);
119119
pinMode(SW_R, INPUT);
120120

121-
ledcSetup(0, 440, 10);
122-
ledcAttachPin(BUZZER, 0);
123-
ledcWrite(0, 1024);
121+
ledcAttach(BUZZER, 440, 10);
122+
ledcWrite(BUZZER, 1024);
124123

125124
pinMode(SLED_FR, OUTPUT);
126125
pinMode(SLED_FL, OUTPUT);
@@ -149,25 +148,25 @@ void initDevice(void)
149148
}
150149
}
151150

152-
g_timer0 = timerBegin(0, 80, true);
153-
timerAttachInterrupt(g_timer0, &onTimer0, false);
154-
timerAlarmWrite(g_timer0, 1000, true);
155-
timerAlarmEnable(g_timer0);
151+
g_timer0 = timerBegin(1000000);
152+
timerAttachInterrupt(g_timer0, &onTimer0);
153+
timerAlarm(g_timer0, 1000, true, 0);
154+
timerStart(g_timer0);
156155

157-
g_timer1 = timerBegin(1, 80, true);
158-
timerAttachInterrupt(g_timer1, &onTimer1, true);
159-
timerAlarmWrite(g_timer1, 500, true);
160-
timerAlarmEnable(g_timer1);
156+
g_timer1 = timerBegin(1000000);
157+
timerAttachInterrupt(g_timer1, &onTimer1);
158+
timerAlarm(g_timer1, 500, true, 0);
159+
timerStart(g_timer1);
161160

162-
g_timer2 = timerBegin(2, 40, true);
163-
timerAttachInterrupt(g_timer2, &isrR, false);
164-
timerAlarmWrite(g_timer2, 13333, true);
165-
timerAlarmEnable(g_timer2);
161+
g_timer2 = timerBegin(2000000);
162+
timerAttachInterrupt(g_timer2, &isrR);
163+
timerAlarm(g_timer2, 13333, true, 0);
164+
timerStart(g_timer2);
166165

167-
g_timer3 = timerBegin(3, 40, true);
168-
timerAttachInterrupt(g_timer3, &isrL, false);
169-
timerAlarmWrite(g_timer3, 13333, true);
170-
timerAlarmEnable(g_timer3);
166+
g_timer3 = timerBegin(2000000);
167+
timerAttachInterrupt(g_timer3, &isrL);
168+
timerAlarm(g_timer3, 13333, true, 0);
169+
timerStart(g_timer3);
171170

172171
Serial.begin(115200);
173172

@@ -199,10 +198,10 @@ void setBLED(char data)
199198
}
200199

201200
//Buzzer
202-
void enableBuzzer(short f) { ledcWriteTone(BUZZER_CH, f); }
201+
void enableBuzzer(short f) { ledcWriteTone(BUZZER, f); }
203202
void disableBuzzer(void)
204203
{
205-
ledcWrite(BUZZER_CH, 1024); //duty 100% Buzzer OFF
204+
ledcWrite(BUZZER, 1024); //duty 100% Buzzer OFF
206205
}
207206

208207
//motor
@@ -266,8 +265,7 @@ unsigned short getSensorR(void)
266265
for (int i = 0; i < WAITLOOP_SLED; i++) {
267266
asm("nop \n");
268267
}
269-
// unsigned short tmp = analogRead(AD3);
270-
unsigned short tmp = adc1_get_raw(ADC1_CHANNEL_5);
268+
unsigned short tmp = analogRead(AD3);
271269
digitalWrite(SLED_R, LOW);
272270
return tmp;
273271
}
@@ -277,8 +275,7 @@ unsigned short getSensorL(void)
277275
for (int i = 0; i < WAITLOOP_SLED; i++) {
278276
asm("nop \n");
279277
}
280-
// unsigned short tmp = analogRead(AD4);
281-
unsigned short tmp = adc1_get_raw(ADC1_CHANNEL_6);
278+
unsigned short tmp = analogRead(AD4);
282279
digitalWrite(SLED_L, LOW);
283280
return tmp;
284281
}
@@ -288,8 +285,7 @@ unsigned short getSensorFL(void)
288285
for (int i = 0; i < WAITLOOP_SLED; i++) {
289286
asm("nop \n");
290287
}
291-
// unsigned short tmp = analogRead(AD2);
292-
unsigned short tmp = adc1_get_raw(ADC1_CHANNEL_4);
288+
unsigned short tmp = analogRead(AD2);
293289
digitalWrite(SLED_FL, LOW); //LED消灯
294290
return tmp;
295291
}
@@ -299,8 +295,7 @@ unsigned short getSensorFR(void)
299295
for (int i = 0; i < WAITLOOP_SLED; i++) {
300296
asm("nop \n");
301297
}
302-
// unsigned short tmp = analogRead(AD1);
303-
unsigned short tmp = adc1_get_raw(ADC1_CHANNEL_3);
298+
unsigned short tmp = analogRead(AD1);
304299
digitalWrite(SLED_FR, LOW);
305300
return tmp;
306301
}

uROS_STEP12_micromouse/fast.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_STEP12_micromouse/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_STEP12_micromouse/map_manager.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_STEP12_micromouse/microROS.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_STEP12_micromouse/misc.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_STEP12_micromouse/run.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_STEP12_micromouse/search.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_STEP12_micromouse/uROS_STEP12_micromouse.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_STEP1_LED/uROS_STEP1_LED.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_STEP2_SWITCH/uROS_STEP2_SWITCH.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.

0 commit comments

Comments
 (0)