static void
performPeriodicTask(void)
{
t_cnt++;
if (t_cnt == 5) {
load_state_ON;
}
if (t_cnt == 10) {
load_state_OFF;
t_cnt=0;
}
if (load_state == ON) {
RelayONOff(1);
} else if (load_state == OFF) {
RelayONOff(0);
}
}
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
static void
performPeriodicTask(void)
{
t_cnt++;
if (t_cnt == 5) {
load_state_ON;
}
if (t_cnt == 10) {
load_state_OFF;
t_cnt=0;
}
if (load_state == ON) {
RelayONOff(1);
} else if (load_state == OFF) {
RelayONOff(0);
}
}
osal_start_timerEx 我也用过,但是发现没反应啊
把你的程序貼上來看看