-->
Page 1 of 1

Calling esp8266 Platform functions from sketch

PostPosted: Mon Jun 07, 2021 2:21 pm
by vgahlaut
Hi Experts,

Can someone explain, why this simple sketch is not working that calls platform function.

Code: Select allextern "C"{
    // Platform Includes
    #include <ets_sys.h>
    #include <os_type.h>
    #include <osapi.h>
    #include <user_interface.h>
}
os_timer_t timer;
void timerCallback(void *arg);

// the setup function runs once when you press reset or power the board
void setup() {
  Serial.begin(115200);
  os_timer_arm(&timer, 1000, 1);
  os_timer_setfn(&timer, timerCallback, NULL);
}

// the loop function runs over and over again forever
void loop() {
}

void timerCallback(void *arg){
  Serial.printf(("Callback Invoked\r\n"));
}