Particle Photon 2 hardware timers QUESTION

Hi Folks,

I am trying to use ameba_soc.h, but I am getting errors.

include "application.h"
extern "C" {
#include "ameba_soc.h" // For hardware timer access
}

This code returns :

timer_init_t coolCycleTimer;
timer_init_t heatCycleTimer;

'timer_init_t' does not name a type

Is that true that Particle does not expose hardware timer APIs on the Photon 2 (RTL872x chipset), and that the cause of the error?

Thank you,

Alex

Particle is not based on Ameba IoT, so that won't work. How did you even get that to compile? That header file isn't anywhere in Device OS.

The RTL872x has very few hardware timers available, and judging from the name, you should be using a software-based timer instead.

1 Like

Hi rickkas7,

Well, it never compiled; I got errors, as I mentioned. I was curious because hardware timers are more precise than software timers. That’s all. I use software timers all the time.

Thanks a lot for the reply!

Alex