Hello,
i wrote a simple 3 phase pulse-packet-control at the beginning of the year.
I can compile it with board management 2.0.17 but now get compile errors with 3.0.7
It looks like that 4 timer-functions are obsolete or changed?
outputs.ino 362 timerAlarmWrite(hw_timer[1], TRIGGER_ANGLE_PHASE_3, false); -> error: 'timerAlarmWrite' was not declared in this scope
outputs.ino 364 timerAlarmEnable(hw_timer[1]); -> error: 'timerAlarmEnable' was not declared in this scope
outputs.ino 447 if (timerStarted(hw_timer[1])) { -> error: 'timerStarted' was not declared in this scope
outputs.ino 1085 timerAttachInterrupt(hw_timer[1], &burst_trigger_isr, false); -> error: too many arguments to function 'void timerAttachInterrupt
I hope someone can help me with new function-names, or other functions who do the same thing I wanted.
Christian
ESP32 Timer changes
ESP32 Timer changes
- Attachments
-
- impulse_packet_control.zip
- (9.99 KiB) Downloaded 59 times
-
- Posts: 858
- Joined: Mon Jul 22, 2019 3:20 pm
Re: ESP32 Timer changes
Hello Ibernstone,
thank you for the migration guide link. I didn't know that one yet.
“Guide” is perhaps a somewhat exaggerated formulation.
A list of removed APIs and new APIs would be the more appropriate formulation.
There is no mention of how to replace the removed API functions with the new ones.
This is not explained in the two example applications in the latest Arduino-ESP32 Timer API either.
Anyway, I was able to solve three compiler errors.
1. the removed API:
Code: Select all
timerAlarmWrite(hw_timer[timer_no], alarm_value, timer_reload);
Code: Select all
timerAlarm(hw_timer[timer_no], alarm_value, timer_reload, 0);
Code: Select all
hw_timer[timer_no] = timerBegin(timer_no, (uint16_t)(getApbFrequency() / TIME_BASE), cnt_up);
Code: Select all
hw_timer[timer_no] = timerBegin((uint16_t)(getApbFrequency() / TIME_BASE));
Code: Select all
timerAttachInterrupt(hw_timer[1], &burst_trigger_isr, false);
Code: Select all
timerAttachInterrupt(hw_timer[1], &burst_trigger_isr);
Code: Select all
if (timerStarted(hw_timer[timer_no])) {
Code: Select all
if (timerAlarmEnabled(hw_timer[timer_no])) {
timerAlarmDisable(hw_timer[timer_no]);
}
You would think that for every removed API there is a new example. It’s a joke
I changed my sample code into a single file sketch.
Once for API 2.0.17 which generates executable code and secondly API 3.0.7 with the mentioned compile errors
It powers consumer at output o1 (phase 1) with 25%, consumer at phase 2 with 50% and consumer at phase 3 with 75% power.
Please help
Chris
- Attachments
-
- impulse_packet_control_3.0.7.zip
- (6.6 KiB) Downloaded 39 times
-
- impulse_packet_control_2_0_17.zip
- (6.6 KiB) Downloaded 37 times
Who is online
Users browsing this forum: No registered users and 25 guests