mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-13 05:28:14 +08:00
fix:ota失败时无数据返回的问题
版本0.4
This commit is contained in:
@@ -20,7 +20,7 @@ void user_led_set( char x )
|
||||
|
||||
bool relay_out( void )
|
||||
{
|
||||
char i;
|
||||
unsigned char i;
|
||||
for ( i = 0; i < PLUG_NUM; i++ )
|
||||
{
|
||||
if ( user_config->plug[i].on != 0 )
|
||||
@@ -30,17 +30,18 @@ bool relay_out( void )
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#define set_relay(a,b) if(((b) == 1) ? Relay_ON : Relay_OFF) MicoGpioOutputHigh( relay[(a)] );else MicoGpioOutputLow( relay[(a)] )
|
||||
|
||||
/*user_relay_set
|
||||
* <20><><EFBFBD>ü̵<C3BC><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* x:<3A><><EFBFBD><EFBFBD> 0-5
|
||||
* y:<3A><><EFBFBD><EFBFBD> 0:<3A><> 1:<3A><>
|
||||
*/
|
||||
void user_relay_set( char x, char y )
|
||||
void user_relay_set(unsigned char x,unsigned char y )
|
||||
{
|
||||
if ( x < 0 || x >= PLUG_NUM ) return;
|
||||
if (x >= PLUG_NUM ) return;
|
||||
|
||||
if((y == 1) ? Relay_ON : Relay_OFF) MicoGpioOutputHigh( relay[x] );else MicoGpioOutputLow( relay[x] );
|
||||
|
||||
set_relay( x, y );
|
||||
user_config->plug[x].on = y;
|
||||
|
||||
if ( relay_out( ) )
|
||||
|
||||
Reference in New Issue
Block a user