Skip to content
Snippets Groups Projects
Commit 1baeda0c authored by Joachim Bach's avatar Joachim Bach
Browse files

removed commented code

parent 1b636cfb
No related branches found
No related tags found
No related merge requests found
...@@ -58,8 +58,6 @@ void exec_user_read_write_uart() ...@@ -58,8 +58,6 @@ void exec_user_read_write_uart()
int i=0, coma_nb=0, value_idx; int i=0, coma_nb=0, value_idx;
unsigned addr, value; unsigned addr, value;
//PRINT("Write an hexadecimal address for reading <addr> or <addr>,<value> for writing or 'switch' to switch user mode or 'status' to show all errors (%s):\n", is_supervisor_mode?"Supervisor":"User");
uart0_send_ref("\r\n", 4); uart0_send_ref("\r\n", 4);
strcpy(str, "\r\nWrite an hexadecimal address for reading <addr> or <addr>,<value> for writing or 'switch' to switch user mode or 'status' to show all errors\r\n"); strcpy(str, "\r\nWrite an hexadecimal address for reading <addr> or <addr>,<value> for writing or 'switch' to switch user mode or 'status' to show all errors\r\n");
...@@ -74,9 +72,6 @@ void exec_user_read_write_uart() ...@@ -74,9 +72,6 @@ void exec_user_read_write_uart()
uart0_send_ref("LPC (user)>", 11); uart0_send_ref("LPC (user)>", 11);
} }
//fflush(stdin);
//fscanf(stdin, "%s",str);
for(int x = 0; x<200; x++) for(int x = 0; x<200; x++)
{ {
str[x] = uart0_rec_byte_ref(); str[x] = uart0_rec_byte_ref();
...@@ -95,13 +90,10 @@ void exec_user_read_write_uart() ...@@ -95,13 +90,10 @@ void exec_user_read_write_uart()
} }
else if(!strcmp(str, "status")) else if(!strcmp(str, "status"))
{ {
//PRINT("Errors : \n");
uart0_send_ref("\r\nErrors :\r\n", 16); uart0_send_ref("\r\nErrors :\r\n", 16);
for(int x = 0; x < error_codes_cpt; x++) for(int x = 0; x < error_codes_cpt; x++)
{ {
//PRINT("Addr: %d -- Error: %d\n", error_codes[x][0],error_codes[x][1]);
snprintf(buffer, sizeof(buffer), "Addr: %d -- Error: %d\r\n", error_codes[x][0], error_codes[x][1]); snprintf(buffer, sizeof(buffer), "Addr: %d -- Error: %d\r\n", error_codes[x][0], error_codes[x][1]);
uart0_send_ref((uint8_t *)buffer, strlen(buffer)); uart0_send_ref((uint8_t *)buffer, strlen(buffer));
} }
...@@ -114,7 +106,6 @@ void exec_user_read_write_uart() ...@@ -114,7 +106,6 @@ void exec_user_read_write_uart()
{ {
if (i==0 || ++coma_nb>1) if (i==0 || ++coma_nb>1)
{ {
//PRINT_SYNTAX_ERROR();
strcpy(str, "\r\nSyntax error! Expected syntax is either <8 characters hexadecimal address> for reading\r\n or <8 characters hexadecimal address>,<8 characters hexadecimal value> for writing\r\n"); strcpy(str, "\r\nSyntax error! Expected syntax is either <8 characters hexadecimal address> for reading\r\n or <8 characters hexadecimal address>,<8 characters hexadecimal value> for writing\r\n");
uart0_send_ref((uint8_t *)str, strlen(str)); uart0_send_ref((uint8_t *)str, strlen(str));
...@@ -124,7 +115,6 @@ void exec_user_read_write_uart() ...@@ -124,7 +115,6 @@ void exec_user_read_write_uart()
value_idx=i+1; value_idx=i+1;
} else if (!isxdigit(str[i])) } else if (!isxdigit(str[i]))
{ {
//PRINT_SYNTAX_ERROR();
strcpy(str, "\r\nSyntax error! Expected syntax is either <8 characters hexadecimal address> for reading\r\n or <8 characters hexadecimal address>,<8 characters hexadecimal value> for writing\r\n"); strcpy(str, "\r\nSyntax error! Expected syntax is either <8 characters hexadecimal address> for reading\r\n or <8 characters hexadecimal address>,<8 characters hexadecimal value> for writing\r\n");
uart0_send_ref((uint8_t *)str, strlen(str)); uart0_send_ref((uint8_t *)str, strlen(str));
return; return;
...@@ -132,22 +122,18 @@ void exec_user_read_write_uart() ...@@ -132,22 +122,18 @@ void exec_user_read_write_uart()
} }
if ((coma_nb&(i<2)) || i>17) if ((coma_nb&(i<2)) || i>17)
{ {
//PRINT_SYNTAX_ERROR();
strcpy(str, "\r\nSyntax error! Expected syntax is either <8 characters hexadecimal address> for reading\r\n or <8 characters hexadecimal address>,<8 characters hexadecimal value> for writing\r\n (Bad length!) \r\n"); strcpy(str, "\r\nSyntax error! Expected syntax is either <8 characters hexadecimal address> for reading\r\n or <8 characters hexadecimal address>,<8 characters hexadecimal value> for writing\r\n (Bad length!) \r\n");
uart0_send_ref((uint8_t *)str, strlen(str)); uart0_send_ref((uint8_t *)str, strlen(str));
//PRINT("(Bad length!)");
return; return;
} }
sscanf(str, "%x", &addr); sscanf(str, "%x", &addr);
if (!coma_nb) // if read if (!coma_nb) // if read
{ {
//PRINT("reading address: 0x%08x\n", addr);
snprintf(buffer, sizeof(buffer), "\r\nreading address: 0x%08x\r\n", addr); snprintf(buffer, sizeof(buffer), "\r\nreading address: 0x%08x\r\n", addr);
uart0_send_ref((uint8_t *)buffer, strlen(buffer)); uart0_send_ref((uint8_t *)buffer, strlen(buffer));
//PRINT("value read: 0x%08x\n", *(unsigned *)addr);
snprintf(buffer, sizeof(buffer), "value read: 0x%08x", *(unsigned *)addr); snprintf(buffer, sizeof(buffer), "value read: 0x%08x", *(unsigned *)addr);
uart0_send_ref((uint8_t *)buffer, strlen(buffer)); uart0_send_ref((uint8_t *)buffer, strlen(buffer));
...@@ -156,8 +142,6 @@ void exec_user_read_write_uart() ...@@ -156,8 +142,6 @@ void exec_user_read_write_uart()
{ {
sscanf(str+value_idx, "%x", &value); sscanf(str+value_idx, "%x", &value);
//PRINT("writing address: 0x%08x with 0x%08x\n", addr, value);
snprintf(buffer, sizeof(buffer), "\r\nwriting address: 0x%08x with 0x%08x", addr, value); snprintf(buffer, sizeof(buffer), "\r\nwriting address: 0x%08x with 0x%08x", addr, value);
uart0_send_ref((uint8_t *)buffer, strlen(buffer)); uart0_send_ref((uint8_t *)buffer, strlen(buffer));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment