mirror of
https://github.com/elua/elua.git
synced 2025-01-25 01:02:54 +08:00
Remove uart.SYS_TIMER and net.SYS_TIMER (use tmr.SYS_TIMER)
This change removes the extra undocumented uart.SYS_TIMER and net.SYS_TIMER constants, which are equal to tmr.SYS_TIMER. The documentation says to use tmr.SYS_TIMER and in the rare case of uart or net being compiled in but not tmr, the system timer can be had by using nil or omitting the parameter.
This commit is contained in:
parent
28d44765c3
commit
d2f5032d63
@ -199,7 +199,6 @@ const LUA_REG_TYPE net_map[] =
|
|||||||
{ LSTRKEY( "ERR_CLOSED" ), LNUMVAL( ELUA_NET_ERR_CLOSED ) },
|
{ LSTRKEY( "ERR_CLOSED" ), LNUMVAL( ELUA_NET_ERR_CLOSED ) },
|
||||||
{ LSTRKEY( "ERR_ABORTED" ), LNUMVAL( ELUA_NET_ERR_ABORTED ) },
|
{ LSTRKEY( "ERR_ABORTED" ), LNUMVAL( ELUA_NET_ERR_ABORTED ) },
|
||||||
{ LSTRKEY( "ERR_OVERFLOW" ), LNUMVAL( ELUA_NET_ERR_OVERFLOW ) },
|
{ LSTRKEY( "ERR_OVERFLOW" ), LNUMVAL( ELUA_NET_ERR_OVERFLOW ) },
|
||||||
{ LSTRKEY( "SYS_TIMER" ), LNUMVAL( PLATFORM_TIMER_SYS_ID ) },
|
|
||||||
{ LSTRKEY( "NO_TIMEOUT" ), LNUMVAL( 0 ) },
|
{ LSTRKEY( "NO_TIMEOUT" ), LNUMVAL( 0 ) },
|
||||||
{ LSTRKEY( "INF_TIMEOUT" ), LNUMVAL( PLATFORM_TIMER_INF_TIMEOUT ) },
|
{ LSTRKEY( "INF_TIMEOUT" ), LNUMVAL( PLATFORM_TIMER_INF_TIMEOUT ) },
|
||||||
#endif
|
#endif
|
||||||
@ -221,7 +220,6 @@ LUALIB_API int luaopen_net( lua_State *L )
|
|||||||
MOD_REG_NUMBER( L, "ERR_CLOSED", ELUA_NET_ERR_CLOSED );
|
MOD_REG_NUMBER( L, "ERR_CLOSED", ELUA_NET_ERR_CLOSED );
|
||||||
MOD_REG_NUMBER( L, "ERR_ABORTED", ELUA_NET_ERR_ABORTED );
|
MOD_REG_NUMBER( L, "ERR_ABORTED", ELUA_NET_ERR_ABORTED );
|
||||||
MOD_REG_NUMBER( L, "ERR_OVERFLOW", ELUA_NET_ERR_OVERFLOW );
|
MOD_REG_NUMBER( L, "ERR_OVERFLOW", ELUA_NET_ERR_OVERFLOW );
|
||||||
MOD_REG_NUMBER( L, "SYS_TIMER", PLATFORM_TIMER_SYS_ID );
|
|
||||||
MOD_REG_NUMBER( L, "NO_TIMEOUT", 0 );
|
MOD_REG_NUMBER( L, "NO_TIMEOUT", 0 );
|
||||||
MOD_REG_NUMBER( L, "INF_TIMEOUT", PLATFORM_TIMER_INF_TIMEOUT );
|
MOD_REG_NUMBER( L, "INF_TIMEOUT", PLATFORM_TIMER_INF_TIMEOUT );
|
||||||
|
|
||||||
|
@ -266,7 +266,6 @@ const LUA_REG_TYPE uart_map[] =
|
|||||||
{ LSTRKEY( "FLOW_NONE" ), LNUMVAL( PLATFORM_UART_FLOW_NONE ) },
|
{ LSTRKEY( "FLOW_NONE" ), LNUMVAL( PLATFORM_UART_FLOW_NONE ) },
|
||||||
{ LSTRKEY( "FLOW_RTS" ), LNUMVAL( PLATFORM_UART_FLOW_RTS ) },
|
{ LSTRKEY( "FLOW_RTS" ), LNUMVAL( PLATFORM_UART_FLOW_RTS ) },
|
||||||
{ LSTRKEY( "FLOW_CTS" ), LNUMVAL( PLATFORM_UART_FLOW_CTS ) },
|
{ LSTRKEY( "FLOW_CTS" ), LNUMVAL( PLATFORM_UART_FLOW_CTS ) },
|
||||||
{ LSTRKEY( "SYS_TIMER" ), LNUMVAL( PLATFORM_TIMER_SYS_ID ) },
|
|
||||||
#endif
|
#endif
|
||||||
#if LUA_OPTIMIZE_MEMORY > 0 && defined( BUILD_SERMUX )
|
#if LUA_OPTIMIZE_MEMORY > 0 && defined( BUILD_SERMUX )
|
||||||
{ LSTRKEY( "__metatable" ), LROVAL( uart_map ) },
|
{ LSTRKEY( "__metatable" ), LROVAL( uart_map ) },
|
||||||
@ -293,7 +292,6 @@ LUALIB_API int luaopen_uart( lua_State *L )
|
|||||||
MOD_REG_NUMBER( L, "FLOW_NONE", PLATFORM_UART_FLOW_NONE );
|
MOD_REG_NUMBER( L, "FLOW_NONE", PLATFORM_UART_FLOW_NONE );
|
||||||
MOD_REG_NUMBER( L, "FLOW_RTS", PLATFORM_UART_FLOW_RTS );
|
MOD_REG_NUMBER( L, "FLOW_RTS", PLATFORM_UART_FLOW_RTS );
|
||||||
MOD_REG_NUMBER( L, "FLOW_CTS", PLATFORM_UART_FLOW_CTS );
|
MOD_REG_NUMBER( L, "FLOW_CTS", PLATFORM_UART_FLOW_CTS );
|
||||||
MOD_REG_NUMBER( L, "SYS_TIMER", PLATFORM_TIMER_SYS_ID );
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
#endif // #if LUA_OPTIMIZE_MEMORY > 0
|
#endif // #if LUA_OPTIMIZE_MEMORY > 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user