hw_timer.c does not compile

dmarkey
Posts: 7
Joined: Tue Mar 24, 2015 6:22 pm

hw_timer.c does not compile

Postby dmarkey » Fri Oct 23, 2015 6:32 am

/Volumes/esp-open-sdk/esp-open-sdk/sdk/include/ets_sys.h:55:20: error: 'NmiTimSetFunc' was not declared in this scope
NmiTimSetFunc(func)
^
app/application.cpp:93:9: note: in expansion of macro 'ETS_FRC_TIMER1_NMI_INTR_ATTACH'
ETS_FRC_TIMER1_NMI_INTR_ATTACH(hw_timer_isr_cb);
^
/Volumes/esp-open-sdk/esp-open-sdk/sdk/include/ets_sys.h:52:62: error: invalid conversion from 'void (*)()' to 'void*' [-fpermissive]

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: hw_timer.c does not compile

Postby ESP_Faye » Mon Oct 26, 2015 3:20 pm

Hi,

Could you provide your test code ?

We will have a try.

Thanks for your interest in ESP8266 !

dmarkey
Posts: 7
Joined: Tue Mar 24, 2015 6:22 pm

Re: hw_timer.c does not compile

Postby dmarkey » Tue Oct 27, 2015 8:00 pm

hw_timer.c is supplied with the SDK!

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: hw_timer.c does not compile

Postby ESP_Faye » Wed Oct 28, 2015 10:44 am

Hi,

I tried to compile the hw_timer.c in ESP8266_NONOS_SDK, it can compile successfully.

Could you provide your test code, and we will have a try ?

lorinliu
Posts: 1
Joined: Sun Mar 20, 2016 10:04 pm

Re: hw_timer.c does not compile

Postby lorinliu » Thu Mar 24, 2016 11:42 am

I just download the newest SDK (v1.4.0) from github, and encounter the same problem.

Below is my patch for this issue.

1. copy driver and header files into project_template folder.

Code: Select all

$ cd ~/project_template
$ cp -raf <ESP8266_RTOS_SDK_V1.4.0>/examples/driver_lib/driver .
$ cp -raf <ESP8266_RTOS_SDK_V1.4.0>/examples/driver_lib/include/* .

2. add driver to be compiled in Makefile

Code: Select all

--- project_template/Makefile   2016-03-24 11:05:24.547352907 +0800
+++ ESP8266_RTOS_SDK_V1.4.0/examples/project_template/Makefile   2016-02-29 18:50:38.000000000 +0800
@@ -23,7 +23,6 @@
 SPECIAL_MKTARGETS=$(APP_MKTARGETS)
 SUBDIRS=    \
    user    \
-   driver   \
    sample_lib
 
 endif # } PDIR
@@ -48,7 +47,6 @@
 
 COMPONENTS_eagle.app.v6 = \
    user/libuser.a  \
-   driver/libdriver.a   \
    sample_lib/libsample.a
 
 LINKFLAGS_eagle.app.v6 = \

3. fix compile error issue according to following patch

Code: Select all

diff -ruNa a/examples/driver_lib/driver/hw_timer.c b/examples/driver_lib/driver/hw_timer.c
--- a/examples/driver_lib/driver/hw_timer.c   2016-03-24 11:00:17.040841331 +0800
+++ b/examples/driver_lib/driver/hw_timer.c   2016-02-29 18:50:38.000000000 +0800
@@ -76,7 +76,7 @@
                       DIVDED_BY_16 | FRC1_ENABLE_TIMER | TM_EDGE_INT);
     }
 
-    _xt_isr_attach(ETS_FRC_TIMER1_INUM, (void *)hw_timer_isr_cb, NULL);
+    _xt_isr_attach(ETS_FRC_TIMER1_INUM, hw_timer_isr_cb, NULL);
 
     TM1_EDGE_INT_ENABLE();
     _xt_isr_unmask(1 << ETS_FRC_TIMER1_INUM);
diff -ruNa a/examples/driver_lib/driver/uart.c b/examples/driver_lib/driver/uart.c
--- a/examples/driver_lib/driver/uart.c       2016-03-24 11:02:23.664113631 +0800
+++ b/examples/driver_lib/driver/uart.c       2016-02-29 18:50:38.000000000 +0800
@@ -421,7 +421,7 @@
     UART_IntrConfig(UART0, &uart_intr);
 
     UART_SetPrintPort(UART0);
-    UART_intr_handler_register(uart0_rx_intr_handler, NULL);
+    UART_intr_handler_register(uart0_rx_intr_handler);
     ETS_UART_INTR_ENABLE();
 
     /*


ESP8266_RTOS_SDK is not professional, not any framework as a SDK, and it's hard to use...maybe you need some experts about embedded software.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: hw_timer.c does not compile

Postby ESP_Faye » Thu Mar 24, 2016 5:17 pm

Hi,

Please download it from github again, we have already updated it https://github.com/espressif/ESP8266_RTOS_SDK.

Thanks for your interest in ESP8266 !

Who is online

Users browsing this forum: No registered users and 14 guests