Pārlūkot izejas kodu

Rebased against current dev

Terry Ellison 4 gadi atpakaļ
vecāks
revīzija
6d81dd6c0a

+ 2 - 0
app/driver/pwm2.c

@@ -7,11 +7,13 @@
 
 #include <stddef.h>
 #include <stdint.h>
+#include <string.h>
 #include "mem.h"
 #include "pin_map.h"
 #include "platform.h"
 #include "hw_timer.h"
 #include "driver/pwm2.h"
+#include "user_interface.h"
 
 #define PWM2_TMR_MAGIC_80MHZ 16
 #define PWM2_TMR_MAGIC_160MHZ 32

+ 1 - 1
app/include/pm/pmSleep.h

@@ -15,7 +15,7 @@
 #if defined(PMSLEEP_DEBUG)
   #define PMSLEEP_DBG(fmt, ...) dbg_printf("\tPMSLEEP(%s):"fmt"\n", __FUNCTION__, ##__VA_ARGS__)
 #else
-  #define PMSLEEP_DBG(...) //c_printf(__VA_ARGS__)
+  #define PMSLEEP_DBG(...) //printf(__VA_ARGS__)
 #endif
 
 #if defined(NODE_ERROR)

+ 1 - 0
app/lua/lflash.c

@@ -14,6 +14,7 @@
 #include "lfunc.h"
 #include "lflash.h"
 #include "platform.h"
+#include "user_interface.h"
 #include "vfs.h"
 #include "uzlib.h"
 

+ 1 - 0
app/modules/bme280.c

@@ -11,6 +11,7 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "user_interface.h"
 #include <math.h>
 
 /****************************************************/

+ 1 - 0
app/modules/bme680.c

@@ -9,6 +9,7 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "user_interface.h"
 #include <math.h>
 
 #include "bme680_defs.h"

+ 1 - 0
app/modules/bmp085.c

@@ -1,6 +1,7 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "user_interface.h"
 #include <stdlib.h>
 #include <string.h>
 

+ 1 - 1
app/modules/file.c

@@ -585,7 +585,7 @@ static int file_putfile( lua_State* L )
 // Lua: fsinfo()
 static int file_fsinfo( lua_State* L )
 {
-  u32_t total, used;
+  uint32_t total, used;
   if (vfs_fsinfo("", &total, &used)) {
     return luaL_error(L, "file system failed");
   }

+ 1 - 0
app/modules/hdc1080.c

@@ -7,6 +7,7 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "user_interface.h"
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>

+ 2 - 0
app/modules/rc.c

@@ -1,7 +1,9 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "user_interface.h"
 #include "rom.h"
+
 //#include "driver/easygpio.h"
 //static Ping_Data pingA;
 #define defPulseLen 185

+ 1 - 0
app/modules/rotary.c

@@ -9,6 +9,7 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "task/task.h"
 #include <stdint.h>
 #include <stdlib.h>
 #include "user_interface.h"

+ 2 - 1
app/modules/tcs34725.c

@@ -22,6 +22,7 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "user_interface.h"
 #include <math.h>
 
 // #define TCS34725_ADDRESS					(0x29<<1)
@@ -352,4 +353,4 @@ LROT_BEGIN(tcs34725)
 LROT_END( tcs34725, NULL, 0 )
 
 
-NODEMCU_MODULE(TCS34725, "tcs34725", tcs34725, NULL);
+NODEMCU_MODULE(TCS34725, "tcs34725", tcs34725, NULL);

+ 1 - 1
app/modules/uart.c

@@ -45,7 +45,7 @@ static int l_uart_on( lua_State* L )
     }
   }
 
-  if (lua_anyfunction(L, stack)) {
+  if (lua_isanyfunction(L, stack)) {
     if (lua_isnumber(L, stack+1) && lua_tointeger(L, stack+1) == 0) {
       run_input = false;
     }

+ 1 - 0
app/modules/wps.c

@@ -4,6 +4,7 @@
 #include "module.h"
 #include "lauxlib.h"
 #include "platform.h"
+#include "user_interface.h"
 
 static int wps_callback_ref;
 

+ 2 - 2
app/platform/platform.c

@@ -1124,7 +1124,7 @@ static void platform_task_dispatch (os_event_t *e) {
 static int task_init_handler (void) {
   int p, qlen = TASK_DEFAULT_QUEUE_LEN;
   for (p = 0; p < TASK_PRIORITY_COUNT; p++){
-    TQB.task_Q[p] = (os_event_t *) c_malloc( sizeof(os_event_t)*qlen );
+    TQB.task_Q[p] = (os_event_t *) malloc( sizeof(os_event_t)*qlen );
     if (TQB.task_Q[p]) {
       os_memset(TQB.task_Q[p], 0, sizeof(os_event_t)*qlen);
       system_os_task(platform_task_dispatch, p, TQB.task_Q[p], TASK_DEFAULT_QUEUE_LEN);
@@ -1146,7 +1146,7 @@ static int task_init_handler (void) {
  */ 
 platform_task_handle_t platform_task_get_id (platform_task_callback_t t) {
   if ( (TQB.task_count & (TH_ALLOCATION_BRICK - 1)) == 0 ) {
-    TQB.task_func = (platform_task_callback_t *) os_realloc(
+    TQB.task_func = (platform_task_callback_t *) realloc(
         TQB.task_func,
         sizeof(platform_task_callback_t) * (TQB.task_count+TH_ALLOCATION_BRICK));
     if (!TQB.task_func) {

+ 1 - 1
app/platform/sdcard.c

@@ -1,7 +1,7 @@
 #include "platform.h"
 #include "driver/spi.h"
 #include <stdint.h>
-
+#include "user_interface.h"
 #include "sdcard.h"