-->
Page 1 of 1

NMI hardware timer in Sming

PostPosted: Sun Feb 05, 2017 12:45 pm
by Jesper Dam
I would like to use the NMI hardware timer in Sming, however it seems that is is not implemented. I'm trying to modify the HardwareTimer.cpp in order to utilize the NMI functionality. To test, I modify the Hardware_Timer constructor to:

Code: Select allHardware_Timer::Hardware_Timer()
{
    //ETS_FRC_TIMER1_INTR_ATTACH((void*)hw_timer_isr_cb, (void *)this);
    // NMICallback = this;
    ETS_FRC_TIMER1_NMI_INTR_ATTACH((void*)hw_timer_isr_cb);
}


to utilize the NMI timer interrupt. However, it does not compile. It get the following compilation error when I compile Sming:

Code: Select allIn file included from system/include/esp_systemapi.h:6:0,
                 from SmingCore/../SmingCore/../Wiring/../include/user_config.h:29,
                 from SmingCore/../SmingCore/../Wiring/WiringFrameworkDependencies.h:11,
                 from SmingCore/../SmingCore/Interrupts.h:15,
                 from SmingCore/HardwareTimer.h:18,
                 from SmingCore/HardwareTimer.cpp:10:
SmingCore/HardwareTimer.cpp: In constructor 'Hardware_Timer::Hardware_Timer()':
/opt/esp-open-sdk/sdk/include/ets_sys.h:56:20: error: 'NmiTimSetFunc' was not declared in this scope
  NmiTimSetFunc(func)
                    ^
SmingCore/HardwareTimer.cpp:53:5: note: in expansion of macro 'ETS_FRC_TIMER1_NMI_INTR_ATTACH'
     ETS_FRC_TIMER1_NMI_INTR_ATTACH((void*)hw_timer_isr_cb);


Can anyone point me in the right direction? Is there another way to enable the NMI functionality?