the ok not working. for the moment work around with bla
This commit is contained in:
parent
a7f16616f0
commit
917aa733ff
|
@ -116,11 +116,12 @@ void manage_bootloader(){
|
||||||
error_code is_error = uart_commands_check(crc_prog, crc_data);
|
error_code is_error = uart_commands_check(crc_prog, crc_data);
|
||||||
if(is_error == ok){
|
if(is_error == ok){
|
||||||
uart_send_ok();
|
uart_send_ok();
|
||||||
break;
|
uart_send("bla\r\n", 5);//putting bla here so OK will show up
|
||||||
|
//removing bla for the moment will make ok not show up
|
||||||
|
launch_program();
|
||||||
}else{
|
}else{
|
||||||
uart_send_err();
|
uart_send_err();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,7 +131,7 @@ int main(void) {
|
||||||
//checksum is correct (
|
//checksum is correct (
|
||||||
//bootloader_init();
|
//bootloader_init();
|
||||||
uart_init(115200);
|
uart_init(115200);
|
||||||
LPC_GPIO0->FIODIR &=~(1<<19);
|
LPC_GPIO0->FIODIR &=~(1<<19); //do I really need this line?
|
||||||
if(is_b_pressed() == 0){
|
if(is_b_pressed() == 0){
|
||||||
if(is_code_valid()){
|
if(is_code_valid()){
|
||||||
launch_program();
|
launch_program();
|
||||||
|
@ -140,7 +141,6 @@ int main(void) {
|
||||||
}else{
|
}else{
|
||||||
manage_bootloader();
|
manage_bootloader();
|
||||||
}
|
}
|
||||||
launch_program();
|
|
||||||
while(1);
|
while(1);
|
||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,20 +121,25 @@ void uart_commands_getid(error_code* status){
|
||||||
|
|
||||||
|
|
||||||
void uart_commands_getserial(error_code* status){
|
void uart_commands_getserial(error_code* status){
|
||||||
char hex[40] = "0x8005018af27a5225a541628f50020c0\r\n";
|
//char hex[40] = "0x8005018af27a5225a541628f50020c0\r\n";
|
||||||
|
char hex[40];
|
||||||
uint32_t res[4];
|
uint32_t res[4];
|
||||||
iap_read_serial(status, res);
|
iap_read_serial(status, res);
|
||||||
/*digit_to_str(hex+1, res[0], 16);
|
digit_to_str(hex+2, res[0], 16);
|
||||||
digit_to_str(hex+9, res[1], 16);
|
|
||||||
digit_to_str(hex+17, res[2], 16);
|
|
||||||
digit_to_str(hex+25, res[3], 16);*/
|
|
||||||
hex[0]='0';
|
hex[0]='0';
|
||||||
hex[1]='x';
|
hex[1]='x';
|
||||||
//sprintf(hex, "0x%x%x%x%x\r\n", res[0], res[1], res[2], res[3]);
|
|
||||||
if(*status == 0){
|
if(*status == 0){
|
||||||
uart_send_ok();
|
uart_send_ok();
|
||||||
uart_send(hex, strlen(hex));
|
uart_send(hex, strlen(hex));
|
||||||
}
|
}
|
||||||
|
digit_to_str(hex, res[1], 16);
|
||||||
|
uart_send(hex, strlen(hex));
|
||||||
|
digit_to_str(hex, res[2], 16);
|
||||||
|
uart_send(hex, strlen(hex));
|
||||||
|
digit_to_str(hex, res[3], 16);
|
||||||
|
uart_send(hex, strlen(hex));
|
||||||
|
uart_send("\r\n", 2);
|
||||||
|
//sprintf(hex, "0x%x%x%x%x\r\n", res[0], res[1], res[2], res[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
crc_t uart_commands_prog(error_code* status, int size){
|
crc_t uart_commands_prog(error_code* status, int size){
|
||||||
|
|
Loading…
Reference in New Issue