fix:ota失败时无数据返回的问题

版本0.4
This commit is contained in:
Zip
2019-03-27 09:00:41 +08:00
parent f9ce1c713f
commit 4b444d2154
13 changed files with 659 additions and 25 deletions

View File

@@ -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( ) )