mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-18 14:28:33 +03:00
fix newline \n\r with \r\n
This commit is contained in:
@@ -30,12 +30,12 @@ void board_exec_dbg_cmd(int ch)
|
||||
{
|
||||
switch (ch) {
|
||||
case '?':
|
||||
printf("\t?\thelp\n\r");
|
||||
printf("\t0-8\tselect physical SIM slot\n\r");
|
||||
printf("\tR\treset SAM3\n\r");
|
||||
printf("\tm\trun mcp23017 test\n\r");
|
||||
printf("\ti\tset card insert via I2C\n\r");
|
||||
printf("\tI\tdisable card insert\n\r");
|
||||
printf("\t?\thelp\r\n");
|
||||
printf("\t0-8\tselect physical SIM slot\r\n");
|
||||
printf("\tR\treset SAM3\r\n");
|
||||
printf("\tm\trun mcp23017 test\r\n");
|
||||
printf("\ti\tset card insert via I2C\r\n");
|
||||
printf("\tI\tdisable card insert\r\n");
|
||||
break;
|
||||
case '0': mux_set_slot(0); break;
|
||||
case '1': mux_set_slot(1); break;
|
||||
@@ -46,7 +46,7 @@ void board_exec_dbg_cmd(int ch)
|
||||
case '6': mux_set_slot(6); break;
|
||||
case '7': mux_set_slot(7); break;
|
||||
case 'R':
|
||||
printf("Asking NVIC to reset us\n\r");
|
||||
printf("Asking NVIC to reset us\r\n");
|
||||
USBD_Disconnect();
|
||||
NVIC_SystemReset();
|
||||
break;
|
||||
@@ -62,7 +62,7 @@ void board_exec_dbg_cmd(int ch)
|
||||
mcp23017_set_output_a(MCP23017_ADDRESS, 0);
|
||||
break;
|
||||
default:
|
||||
printf("Unknown command '%c'\n\r", ch);
|
||||
printf("Unknown command '%c'\r\n", ch);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ int board_override_enter_dfu(void)
|
||||
/* Enter DFU bootloader in case the respective button is pressed */
|
||||
if (PIO_Get(&bl_sw_pin) == 0) {
|
||||
/* do not print to early since the console is not initialized yet */
|
||||
//printf("BOOTLOADER switch pressed -> Force DFU\n\r");
|
||||
//printf("BOOTLOADER switch pressed -> Force DFU\r\n");
|
||||
return 1;
|
||||
} else
|
||||
return 0;
|
||||
|
||||
@@ -94,7 +94,7 @@ out_stop:
|
||||
|
||||
int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb)
|
||||
{
|
||||
TRACE_DEBUG("mcp23017_init\n\r");
|
||||
TRACE_DEBUG("mcp23017_init\r\n");
|
||||
|
||||
// all gpio input
|
||||
if (mcp23017_write_byte(slave, MCP23017_IODIRA, iodira))
|
||||
@@ -105,23 +105,23 @@ int mcp23017_init(uint8_t slave, uint8_t iodira, uint8_t iodirb)
|
||||
if (mcp23017_write_byte(slave, MCP23017_IOCONA, 0x20)) //disable SEQOP (autoinc addressing)
|
||||
goto out_err;
|
||||
|
||||
TRACE_DEBUG("mcp23017 found\n\r");
|
||||
TRACE_DEBUG("mcp23017 found\r\n");
|
||||
return 0;
|
||||
|
||||
out_err:
|
||||
TRACE_WARNING("mcp23017 NOT found!\n\r");
|
||||
TRACE_WARNING("mcp23017 NOT found!\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int mcp23017_test(uint8_t slave)
|
||||
{
|
||||
printf("mcp23017_test\n\r");
|
||||
printf("GPIOA 0x%x\n\r", mcp23017_read_byte(slave,MCP23017_GPIOA));
|
||||
printf("GPIOB 0x%x\n\r", mcp23017_read_byte(slave,MCP23017_GPIOB));
|
||||
printf("IODIRA 0x%x\n\r", mcp23017_read_byte(slave,MCP23017_IODIRA));
|
||||
printf("IODIRB 0x%x\n\r", mcp23017_read_byte(slave,MCP23017_IODIRB));
|
||||
printf("IOCONA 0x%x\n\r", mcp23017_read_byte(slave,MCP23017_IOCONA));
|
||||
printf("IOCONB 0x%x\n\r", mcp23017_read_byte(slave,MCP23017_IOCONB));
|
||||
printf("mcp23017_test\r\n");
|
||||
printf("GPIOA 0x%x\r\n", mcp23017_read_byte(slave,MCP23017_GPIOA));
|
||||
printf("GPIOB 0x%x\r\n", mcp23017_read_byte(slave,MCP23017_GPIOB));
|
||||
printf("IODIRA 0x%x\r\n", mcp23017_read_byte(slave,MCP23017_IODIRA));
|
||||
printf("IODIRB 0x%x\r\n", mcp23017_read_byte(slave,MCP23017_IODIRB));
|
||||
printf("IOCONA 0x%x\r\n", mcp23017_read_byte(slave,MCP23017_IOCONA));
|
||||
printf("IOCONB 0x%x\r\n", mcp23017_read_byte(slave,MCP23017_IOCONB));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -142,13 +142,13 @@ int mcp23017_toggle(uint8_t slave)
|
||||
static bool foo=false;
|
||||
if (foo)
|
||||
{
|
||||
printf("+\n\r");
|
||||
printf("+\r\n");
|
||||
mcp23017_write_byte(slave, MCP23017_OLATB, 0x80);
|
||||
foo=false;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("-\n\r");
|
||||
printf("-\r\n");
|
||||
mcp23017_write_byte(slave, MCP23017_OLATB, 0x00);
|
||||
foo=true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user