__attribute__((section(".DTCM"),zero_init)) static ota_t g_ota;
+char * ota_status( void )
+{
+ static char ota_st_str[50];
+ if( !g_ota.task || !g_ota.fw_size )
+ return NULL;
+
+ sprintf( ota_st_str, "ota - %d%%", g_ota.fw_received*100/g_ota.fw_size );
+
+ return ota_st_str;
+}
int32_t ota_start( uint32_t link, char * url, char *ver )
{
if( i < txt_sz )
tx_buf[ tx_n++ ] = txt[i];
else
- tx_buf[ tx_n++ ] = 0;
+ tx_buf[ tx_n++ ] = 0xFF;
}
// crc = 0; //crc16(tx_buf, tx_n);
EventBits_t uxBits;
static uint32_t n = 0;
char port_str[8];
+ int32_t ota_disp = 0;
//LCD Power ON
n = 0;
///lcd_read( lcd_welding_method_addr, 3 );
}
+
+ {
+ extern char * ota_status( void );
+ char *s = ota_status();
+ if( !s ){
+ if(ota_disp){
+ //ota stop, clear ota stauts str
+ ota_disp = 0;
+ lcd_write_text( lcd_msg_2_addr, (uint8_t*)" ", lcd_msg_2_size );
+ }
+ }else{
+ //ota_start
+ ota_disp = 1;
+ lcd_write_text( lcd_msg_2_addr, (uint8_t*)s, lcd_msg_2_size );
+ }
+ }
osDelay(1);
}
}