Rebased against current dev

This commit is contained in:
Terry Ellison 2019-07-23 20:46:49 +01:00
parent bc98174e82
commit 39bb60e75a
15 changed files with 19 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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) { if (lua_isnumber(L, stack+1) && lua_tointeger(L, stack+1) == 0) {
run_input = false; run_input = false;
} }

View File

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

View File

@ -1124,7 +1124,7 @@ static void platform_task_dispatch (os_event_t *e) {
static int task_init_handler (void) { static int task_init_handler (void) {
int p, qlen = TASK_DEFAULT_QUEUE_LEN; int p, qlen = TASK_DEFAULT_QUEUE_LEN;
for (p = 0; p < TASK_PRIORITY_COUNT; p++){ 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]) { if (TQB.task_Q[p]) {
os_memset(TQB.task_Q[p], 0, sizeof(os_event_t)*qlen); 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); 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) { platform_task_handle_t platform_task_get_id (platform_task_callback_t t) {
if ( (TQB.task_count & (TH_ALLOCATION_BRICK - 1)) == 0 ) { 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, TQB.task_func,
sizeof(platform_task_callback_t) * (TQB.task_count+TH_ALLOCATION_BRICK)); sizeof(platform_task_callback_t) * (TQB.task_count+TH_ALLOCATION_BRICK));
if (!TQB.task_func) { if (!TQB.task_func) {

View File

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