fix newline \n\r with \r\n

This commit is contained in:
Alexander Couzens 2022-01-24 11:44:35 +01:00
parent 7674b08519
commit 87f8de15b4
38 changed files with 378 additions and 378 deletions

View File

@ -113,15 +113,15 @@ extern int main(void)
EEFC_ReadUniqueID(g_unique_id);
printf("\n\r\n\r");
printf("bootloader updater %s for board %s\n\r"
"(C) 2010-2017 by Harald Welte, 2018-2019 by Kevin Redon\n\r",
printf("\r\n\r\n");
printf("bootloader updater %s for board %s\r\n"
"(C) 2010-2017 by Harald Welte, 2018-2019 by Kevin Redon\r\n",
manifest_revision, manifest_board);
/* clear g_dfu on power-up reset */
memset(g_dfu, 0, sizeof(*g_dfu));
TRACE_INFO("USB init...\n\r");
TRACE_INFO("USB init...\r\n");
/* Signal USB reset by disabling the pull-up on USB D+ for at least 10 ms */
USBD_Disconnect();

View File

@ -160,7 +160,7 @@ extern int main(void)
print_banner();
board_main_top();
TRACE_INFO("USB init...\n\r");
TRACE_INFO("USB init...\r\n");
SIMtrace_USB_Initialize();
while (USBD_GetState() < USBD_STATE_CONFIGURED) {
@ -169,7 +169,7 @@ extern int main(void)
#if 0
if (i >= MAX_USB_ITER * 3) {
TRACE_ERROR("Resetting board (USB could "
"not be configured)\n\r");
"not be configured)\r\n");
USBD_Disconnect();
NVIC_SystemReset();
}
@ -177,19 +177,19 @@ extern int main(void)
i++;
}
TRACE_INFO("calling configure of all configurations...\n\r");
TRACE_INFO("calling configure of all configurations...\r\n");
for (i = 1; i < ARRAY_SIZE(config_func_ptrs); i++) {
if (config_func_ptrs[i].configure)
config_func_ptrs[i].configure();
}
TRACE_INFO("calling init of config %u...\n\r", simtrace_config);
TRACE_INFO("calling init of config %u...\r\n", simtrace_config);
if (config_func_ptrs[simtrace_config].init) {
config_func_ptrs[simtrace_config].init();
}
last_simtrace_config = simtrace_config;
TRACE_INFO("entering main loop...\n\r");
TRACE_INFO("entering main loop...\r\n");
while (1) {
WDT_Restart(WDT);
#if TRACE_LEVEL >= TRACE_LEVEL_DEBUG
@ -207,12 +207,12 @@ extern int main(void)
isUsbConnected = 0;
}
} else if (isUsbConnected == 0) {
TRACE_INFO("USB is now configured\n\r");
TRACE_INFO("USB is now configured\r\n");
isUsbConnected = 1;
}
if (last_simtrace_config != simtrace_config) {
TRACE_INFO("USB config chg %u -> %u\n\r",
TRACE_INFO("USB config chg %u -> %u\r\n",
last_simtrace_config, simtrace_config);
if (config_func_ptrs[last_simtrace_config].exit) {
config_func_ptrs[last_simtrace_config].exit();

View File

@ -78,9 +78,9 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset,
}
#if TRACE_LEVEL >= TRACE_LEVEL_INFO
TRACE_INFO("dnload(altif=%u, offset=%u, len=%u)\n\r", altif, offset, len);
TRACE_INFO("dnload(altif=%u, offset=%u, len=%u)\r\n", altif, offset, len);
#else
printf("DL off=%u\n\r", offset);
printf("DL off=%u\r\n", offset);
#endif
#ifdef PINS_LEDS
@ -113,19 +113,19 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset,
}
rc = FLASHD_Unlock(addr, addr + len, 0, 0);
if (rc != 0) {
TRACE_ERROR("DFU download flash unlock failed\n\r");
TRACE_ERROR("DFU download flash unlock failed\r\n");
rc = DFU_RET_STALL;
break;
}
rc = FLASHD_Write(addr, data, len);
if (rc != 0) {
TRACE_ERROR("DFU download flash erase failed\n\r");
TRACE_ERROR("DFU download flash erase failed\r\n");
rc = DFU_RET_STALL;
break;
}
for (i = 0; i < len; i++) {
if (((uint8_t*)addr)[i]!=data[i]) {
TRACE_ERROR("DFU download flash data written not correct\n\r");
TRACE_ERROR("DFU download flash data written not correct\r\n");
rc = DFU_RET_STALL;
break;
}
@ -133,7 +133,7 @@ int USBDFU_handle_dnload(uint8_t altif, unsigned int offset,
rc = DFU_RET_ZLP;
break;
default:
TRACE_ERROR("DFU download for unknown AltIf %d\n\r", altif);
TRACE_ERROR("DFU download for unknown AltIf %d\r\n", altif);
rc = DFU_RET_STALL;
break;
}
@ -179,11 +179,11 @@ int USBDFU_handle_upload(uint8_t altif, unsigned int offset,
memcpy(data, (void *)addr, req_len);
break;
default:
TRACE_ERROR("DFU upload for unknown AltIf %d\n\r", altif);
TRACE_ERROR("DFU upload for unknown AltIf %d\r\n", altif);
/* FIXME: set error codes */
return -1;
}
printf("=%u\n\r", req_len);
printf("=%u\r\n", req_len);
return req_len;
}
@ -274,16 +274,16 @@ extern int main(void)
EEFC_ReadUniqueID(g_unique_id);
printf("\n\r\n\r");
printf("\r\n\r\n");
print_line();
printf("DFU bootloader %s for board %s\n\r"
"(C) 2010-2017 by Harald Welte, 2018-2019 by Kevin Redon\n\r",
printf("DFU bootloader %s for board %s\r\n"
"(C) 2010-2017 by Harald Welte, 2018-2019 by Kevin Redon\r\n",
manifest_revision, manifest_board);
print_line();
#if (TRACE_LEVEL >= TRACE_LEVEL_INFO)
TRACE_INFO("Chip ID: 0x%08lx (Ext 0x%08lx)\n\r", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID);
TRACE_INFO("Serial Nr. %08x-%08x-%08x-%08x\n\r",
TRACE_INFO("Chip ID: 0x%08lx (Ext 0x%08lx)\r\n", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID);
TRACE_INFO("Serial Nr. %08x-%08x-%08x-%08x\r\n",
g_unique_id[0], g_unique_id[1],
g_unique_id[2], g_unique_id[3]);
static const char* reset_causes[] = {
@ -294,9 +294,9 @@ extern int main(void)
"user reset (NRST pin detected low)",
};
if (reset_cause < ARRAY_SIZE(reset_causes)) {
TRACE_INFO("Reset Cause: %s\n\r", reset_causes[reset_cause]);
TRACE_INFO("Reset Cause: %s\r\n", reset_causes[reset_cause]);
} else {
TRACE_INFO("Reset Cause: 0x%lx\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos);
TRACE_INFO("Reset Cause: 0x%lx\r\n", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos);
}
#endif
@ -306,25 +306,25 @@ extern int main(void)
switch (USBDFU_OverrideEnterDFU()) {
case 0:
if (SCB->VTOR < IFLASH_ADDR + BOARD_DFU_BOOT_SIZE) {
TRACE_INFO_WP("unknown\n\r");
TRACE_INFO_WP("unknown\r\n");
} else {
TRACE_INFO_WP("DFU is the main application\n\r");
TRACE_INFO_WP("DFU is the main application\r\n");
}
break;
case 1:
TRACE_INFO_WP("DFU switch requested by main application\n\r");
TRACE_INFO_WP("DFU switch requested by main application\r\n");
break;
case 2:
TRACE_INFO_WP("bootloader forced (button pressed or jumper set)\n\r");
TRACE_INFO_WP("bootloader forced (button pressed or jumper set)\r\n");
break;
case 3:
TRACE_INFO_WP("stack pointer (first application word) does no point in RAM\n\r");
TRACE_INFO_WP("stack pointer (first application word) does no point in RAM\r\n");
break;
case 4: // the is no reason
TRACE_INFO_WP("reset vector (second application word) does no point in flash\n\r");
TRACE_INFO_WP("reset vector (second application word) does no point in flash\r\n");
break;
default:
TRACE_INFO_WP("unknown\n\r");
TRACE_INFO_WP("unknown\r\n");
break;
}
#endif
@ -335,7 +335,7 @@ extern int main(void)
board_main_top();
TRACE_INFO("USB init...\n\r");
TRACE_INFO("USB init...\r\n");
/* Signal USB reset by disabling the pull-up on USB D+ for at least 10 ms */
USBD_Disconnect();
mdelay(500);
@ -346,7 +346,7 @@ extern int main(void)
check_exec_dbg_cmd();
#if 1
if (i >= MAX_USB_ITER * 3) {
TRACE_ERROR("Resetting board (USB could not be configured)\n\r");
TRACE_ERROR("Resetting board (USB could not be configured)\r\n");
g_dfu->magic = USB_DFU_MAGIC; // start the bootloader after reboot
USBD_Disconnect();
NVIC_SystemReset();
@ -358,7 +358,7 @@ extern int main(void)
/* Initialize the flash to be able to write it, using the IAP ROM code */
FLASHD_Initialize(BOARD_MCK, 1);
TRACE_INFO("entering main loop...\n\r");
TRACE_INFO("entering main loop...\r\n");
while (1) {
WDT_Restart(WDT);
#if TRACE_LEVEL >= TRACE_LEVEL_DEBUG
@ -378,7 +378,7 @@ extern int main(void)
isUsbConnected = 0;
}
} else if (isUsbConnected == 0) {
TRACE_INFO("USB is now configured\n\r");
TRACE_INFO("USB is now configured\r\n");
isUsbConnected = 1;
}

View File

@ -32,17 +32,17 @@ extern int main(void)
PIO_InitializeInterrupts(0);
printf("\n\r\n\r"
"=============================================================================\n\r"
"Freq Ctr firmware " GIT_VERSION " (C) 2019 by Harald Welte\n\r"
"=============================================================================\n\r");
printf("\r\n\r\n"
"=============================================================================\r\n"
"Freq Ctr firmware " GIT_VERSION " (C) 2019 by Harald Welte\r\n"
"=============================================================================\r\n");
board_main_top();
TRACE_INFO("starting frequency counter...\n\r");
TRACE_INFO("starting frequency counter...\r\n");
freq_ctr_init();
TRACE_INFO("entering main loop...\n\r");
TRACE_INFO("entering main loop...\r\n");
while (1) {
WDT_Restart(WDT);

View File

@ -4,5 +4,5 @@
void gpio_test_init(void)
{
printf("FIXME run tests here\n\r");
printf("FIXME run tests here\r\n");
}

View File

@ -32,17 +32,17 @@ extern int main(void)
PIO_InitializeInterrupts(0);
printf("\n\r\n\r"
"=============================================================================\n\r"
"GPIO Test firmware " GIT_VERSION " (C) 2019 Sysmocom GmbH\n\r"
"=============================================================================\n\r");
printf("\r\n\r\n"
"=============================================================================\r\n"
"GPIO Test firmware " GIT_VERSION " (C) 2019 Sysmocom GmbH\r\n"
"=============================================================================\r\n");
board_main_top();
TRACE_INFO("starting gpio test...\n\r");
TRACE_INFO("starting gpio test...\r\n");
gpio_test_init();
TRACE_INFO("entering main loop...\n\r");
TRACE_INFO("entering main loop...\r\n");
while (1) {
WDT_Restart(WDT);

View File

@ -156,7 +156,7 @@ extern int main(void)
print_banner();
board_main_top();
TRACE_INFO("USB init...\n\r");
TRACE_INFO("USB init...\r\n");
SIMtrace_USB_Initialize();
while (USBD_GetState() < USBD_STATE_CONFIGURED) {
@ -165,7 +165,7 @@ extern int main(void)
#if 0
if (i >= MAX_USB_ITER * 3) {
TRACE_ERROR("Resetting board (USB could "
"not be configured)\n\r");
"not be configured)\r\n");
USBD_Disconnect();
NVIC_SystemReset();
}
@ -173,17 +173,17 @@ extern int main(void)
i++;
}
TRACE_INFO("calling configure of all configurations...\n\r");
TRACE_INFO("calling configure of all configurations...\r\n");
for (i = 1; i < ARRAY_SIZE(config_func_ptrs); i++) {
if (config_func_ptrs[i].configure)
config_func_ptrs[i].configure();
}
TRACE_INFO("calling init of config %u...\n\r", simtrace_config);
TRACE_INFO("calling init of config %u...\r\n", simtrace_config);
config_func_ptrs[simtrace_config].init();
last_simtrace_config = simtrace_config;
TRACE_INFO("entering main loop...\n\r");
TRACE_INFO("entering main loop...\r\n");
while (1) {
WDT_Restart(WDT);
#if TRACE_LEVEL >= TRACE_LEVEL_DEBUG
@ -201,12 +201,12 @@ extern int main(void)
isUsbConnected = 0;
}
} else if (isUsbConnected == 0) {
TRACE_INFO("USB is now configured\n\r");
TRACE_INFO("USB is now configured\r\n");
isUsbConnected = 1;
}
if (last_simtrace_config != simtrace_config) {
TRACE_INFO("USB config chg %u -> %u\n\r",
TRACE_INFO("USB config chg %u -> %u\r\n",
last_simtrace_config, simtrace_config);
config_func_ptrs[last_simtrace_config].exit();
config_func_ptrs[simtrace_config].init();

View File

@ -767,7 +767,7 @@ static void UDP_EndpointHandler(uint8_t bEndpoint)
}
else {
// Acknowledge interrupt
TRACE_ERROR("Error Wr%d, %x\n\r", bEndpoint, pEndpoint->state);
TRACE_ERROR("Error Wr%d, %x\r\n", bEndpoint, pEndpoint->state);
CLEAR_CSR(bEndpoint, UDP_CSR_TXCOMP);
}
}
@ -914,11 +914,11 @@ static inline uint8_t UDP_Write(uint8_t bEndpoint,
/* int i;
for (i = 0; i < dLength; i++) {
if (!(i%16)) {
printf("\n\r");
printf("\r\n");
}
printf("0x%x ", ((uint8_t*)pData)[i]);
}
printf("\n\r");
printf("\r\n");
*/
/* Setup the transfer descriptor */
@ -1053,11 +1053,11 @@ static inline uint8_t UDP_Read(uint8_t bEndpoint,
/* int i;
for (i = 0; i < dLength; i++) {
if (!(i%16)) {
printf("\n\r");
printf("\r\n");
}
printf("0x%x ", ((uint8_t*)pData)[i]);
}
printf("\n\r");
printf("\r\n");
*/
/* Set the transfer descriptor */
@ -1114,7 +1114,7 @@ void USBD_IrqHandler(void)
/* Return immediately if there is no interrupt to service */
if (status == 0) {
TRACE_DEBUG_WP(".\n\r");
TRACE_DEBUG_WP(".\r\n");
return;
}
@ -1212,7 +1212,7 @@ void USBD_IrqHandler(void)
if (status != 0) {
TRACE_DEBUG_WP("\n\r - ");
TRACE_DEBUG_WP("\r\n - ");
}
}
eptnum++;
@ -1221,7 +1221,7 @@ void USBD_IrqHandler(void)
/* Toggle LED back to its previous state */
TRACE_DEBUG_WP("!");
TRACE_DEBUG_WP("\n\r");
TRACE_DEBUG_WP("\r\n");
if (USBD_GetState() >= USBD_STATE_POWERED) {
//LED_Clear(USBD_LEDUSB);
@ -1581,7 +1581,7 @@ void USBD_HAL_SetConfiguration(uint8_t cfgnum)
*/
void USBD_HAL_Init(void)
{
TRACE_DEBUG("%s\n\r", "USBD_HAL_Init");
TRACE_DEBUG("%s\r\n", "USBD_HAL_Init");
/* Must before USB & TXVC access! */
UDP_EnablePeripheralClock();
@ -1610,7 +1610,7 @@ uint8_t USBD_HAL_Stall(uint8_t bEP)
/* Check that endpoint is in Idle state */
if (pEndpoint->state != UDP_ENDPOINT_IDLE) {
TRACE_WARNING("UDP_Stall: EP%d locked\n\r", bEP);
TRACE_WARNING("UDP_Stall: EP%d locked\r\n", bEP);
return USBD_STATUS_LOCKED;
}
/* STALL endpoint */

View File

@ -163,7 +163,7 @@ extern void EFC_TranslateAddress( Efc** ppEfc, uint32_t dwAddress, uint16_t* pwP
wPage = (dwAddress - IFLASH_ADDR) / IFLASH_PAGE_SIZE;
wOffset = (dwAddress - IFLASH_ADDR) % IFLASH_PAGE_SIZE;
TRACE_DEBUG( "Translated 0x%08lX to page=%d and offset=%d\n\r", dwAddress, wPage, wOffset ) ;
TRACE_DEBUG( "Translated 0x%08lX to page=%d and offset=%d\r\n", dwAddress, wPage, wOffset ) ;
/* Store values */
if ( pEfc )
{

View File

@ -134,7 +134,7 @@ static void ComputeLockRange( uint32_t dwStart, uint32_t dwEnd, uint32_t *pdwAct
// Store actual page numbers
EFC_ComputeAddress( pStartEfc, wActualStartPage, 0, pdwActualStart ) ;
EFC_ComputeAddress( pEndEfc, wActualEndPage, 0, pdwActualEnd ) ;
TRACE_DEBUG( "Actual lock range is 0x%06lX - 0x%06lX\n\r", *pdwActualStart, *pdwActualEnd ) ;
TRACE_DEBUG( "Actual lock range is 0x%06lX - 0x%06lX\r\n", *pdwActualStart, *pdwActualEnd ) ;
}

View File

@ -104,7 +104,7 @@ extern void PioInterruptHandler( uint32_t id, Pio *pPio )
/* Check pending events */
if ( status != 0 )
{
TRACE_DEBUG( "PIO interrupt on PIO controller #%" PRIu32 "\n\r", id ) ;
TRACE_DEBUG( "PIO interrupt on PIO controller #%" PRIu32 "\r\n", id ) ;
/* Find triggering source */
i = 0;
@ -119,7 +119,7 @@ extern void PioInterruptHandler( uint32_t id, Pio *pPio )
/* Source has PIOs whose statuses have changed */
if ( (status & _aIntSources[i].pPin->mask) != 0 )
{
TRACE_DEBUG( "Interrupt source #%" PRIu32 " triggered\n\r", i ) ;
TRACE_DEBUG( "Interrupt source #%" PRIu32 " triggered\r\n", i ) ;
_aIntSources[i].handler(_aIntSources[i].pPin);
status &= ~(_aIntSources[i].pPin->mask);
@ -177,13 +177,13 @@ extern void PIOC_IrqHandler( void )
*/
extern void PIO_InitializeInterrupts( uint32_t dwPriority )
{
TRACE_DEBUG( "PIO_Initialize()\n\r" ) ;
TRACE_DEBUG( "PIO_Initialize()\r\n" ) ;
/* Reset sources */
_dwNumSources = 0 ;
/* Configure PIO interrupt sources */
TRACE_DEBUG( "PIO_Initialize: Configuring PIOA\n\r" ) ;
TRACE_DEBUG( "PIO_Initialize: Configuring PIOA\r\n" ) ;
PMC_EnablePeripheral( ID_PIOA ) ;
PIOA->PIO_ISR ;
PIOA->PIO_IDR = 0xFFFFFFFF ;
@ -192,7 +192,7 @@ extern void PIO_InitializeInterrupts( uint32_t dwPriority )
NVIC_SetPriority( PIOA_IRQn, dwPriority ) ;
NVIC_EnableIRQ( PIOA_IRQn ) ;
TRACE_DEBUG( "PIO_Initialize: Configuring PIOB\n\r" ) ;
TRACE_DEBUG( "PIO_Initialize: Configuring PIOB\r\n" ) ;
PMC_EnablePeripheral( ID_PIOB ) ;
PIOB->PIO_ISR ;
PIOB->PIO_IDR = 0xFFFFFFFF ;
@ -201,7 +201,7 @@ extern void PIO_InitializeInterrupts( uint32_t dwPriority )
NVIC_SetPriority( PIOB_IRQn, dwPriority ) ;
NVIC_EnableIRQ( PIOB_IRQn ) ;
TRACE_DEBUG( "PIO_Initialize: Configuring PIOC\n\r" ) ;
TRACE_DEBUG( "PIO_Initialize: Configuring PIOC\r\n" ) ;
PMC_EnablePeripheral( ID_PIOC ) ;
PIOC->PIO_ISR ;
PIOC->PIO_IDR = 0xFFFFFFFF ;
@ -234,7 +234,7 @@ extern void PIO_ConfigureIt( const Pin *pPin, void (*handler)( const Pin* ) )
Pio* pio ;
InterruptSource* pSource ;
TRACE_DEBUG( "PIO_ConfigureIt()\n\r" ) ;
TRACE_DEBUG( "PIO_ConfigureIt()\r\n" ) ;
assert( pPin ) ;
pio = pPin->pio ;
@ -242,7 +242,7 @@ extern void PIO_ConfigureIt( const Pin *pPin, void (*handler)( const Pin* ) )
pSource = find_intsource4pin(pPin);
if (!pSource) {
/* Define new source */
TRACE_DEBUG( "PIO_ConfigureIt: Defining new source #%" PRIu32 ".\n\r", _dwNumSources ) ;
TRACE_DEBUG( "PIO_ConfigureIt: Defining new source #%" PRIu32 ".\r\n", _dwNumSources ) ;
assert( _dwNumSources < MAX_INTERRUPT_SOURCES ) ;
pSource = &(_aIntSources[_dwNumSources]) ;
pSource->pPin = pPin ;
@ -288,7 +288,7 @@ extern void PIO_ConfigureIt( const Pin *pPin, void (*handler)( const Pin* ) )
*/
extern void PIO_EnableIt( const Pin *pPin )
{
TRACE_DEBUG( "PIO_EnableIt()\n\r" ) ;
TRACE_DEBUG( "PIO_EnableIt()\r\n" ) ;
assert( pPin != NULL ) ;
@ -320,7 +320,7 @@ extern void PIO_DisableIt( const Pin *pPin )
{
assert( pPin != NULL ) ;
TRACE_DEBUG( "PIO_DisableIt()\n\r" ) ;
TRACE_DEBUG( "PIO_DisableIt()\r\n" ) ;
pPin->pio->PIO_IDR = pPin->mask;
}

View File

@ -63,7 +63,7 @@ extern void PMC_EnablePeripheral( uint32_t dwId )
{
if ( (PMC->PMC_PCSR0 & ((uint32_t)1 << dwId)) == ((uint32_t)1 << dwId) )
{
TRACE_DEBUG( "PMC_EnablePeripheral: clock of peripheral" " %" PRIu32 " is already enabled\n\r", dwId ) ;
TRACE_DEBUG( "PMC_EnablePeripheral: clock of peripheral" " %" PRIu32 " is already enabled\r\n", dwId ) ;
}
else
{
@ -75,7 +75,7 @@ extern void PMC_EnablePeripheral( uint32_t dwId )
dwId -= 32;
if ((PMC->PMC_PCSR1 & ((uint32_t)1 << dwId)) == ((uint32_t)1 << dwId))
{
TRACE_DEBUG( "PMC_EnablePeripheral: clock of peripheral" " %" PRIu32 " is already enabled\n\r", dwId + 32 ) ;
TRACE_DEBUG( "PMC_EnablePeripheral: clock of peripheral" " %" PRIu32 " is already enabled\r\n", dwId + 32 ) ;
}
else
{
@ -100,7 +100,7 @@ extern void PMC_DisablePeripheral( uint32_t dwId )
{
if ( (PMC->PMC_PCSR0 & ((uint32_t)1 << dwId)) != ((uint32_t)1 << dwId) )
{
TRACE_DEBUG("PMC_DisablePeripheral: clock of peripheral" " %" PRIu32 " is not enabled\n\r", dwId ) ;
TRACE_DEBUG("PMC_DisablePeripheral: clock of peripheral" " %" PRIu32 " is not enabled\r\n", dwId ) ;
}
else
{
@ -112,7 +112,7 @@ extern void PMC_DisablePeripheral( uint32_t dwId )
dwId -= 32 ;
if ( (PMC->PMC_PCSR1 & ((uint32_t)1 << dwId)) != ((uint32_t)1 << dwId) )
{
TRACE_DEBUG( "PMC_DisablePeripheral: clock of peripheral" " %" PRIu32 " is not enabled\n\r", dwId + 32 ) ;
TRACE_DEBUG( "PMC_DisablePeripheral: clock of peripheral" " %" PRIu32 " is not enabled\r\n", dwId + 32 ) ;
}
else
{
@ -132,7 +132,7 @@ extern void PMC_EnableAllPeripherals( void )
PMC->PMC_PCER1 = MASK_STATUS1 ;
while ( (PMC->PMC_PCSR1 & MASK_STATUS1) != MASK_STATUS1 ) ;
TRACE_DEBUG( "Enable all periph clocks\n\r" ) ;
TRACE_DEBUG( "Enable all periph clocks\r\n" ) ;
}
/**
@ -146,7 +146,7 @@ extern void PMC_DisableAllPeripherals( void )
PMC->PMC_PCDR1 = MASK_STATUS1 ;
while ( (PMC->PMC_PCSR1 & MASK_STATUS1) != 0 ) ;
TRACE_DEBUG( "Disable all periph clocks\n\r" ) ;
TRACE_DEBUG( "Disable all periph clocks\r\n" ) ;
}
/**

View File

@ -198,7 +198,7 @@ void USART_Write(
if (timeOut == 0) {
TRACE_ERROR("USART_Write: Timed out.\n\r");
TRACE_ERROR("USART_Write: Timed out.\r\n");
return;
}
timeOut--;
@ -269,7 +269,7 @@ uint16_t USART_Read(
if (timeOut == 0) {
TRACE_ERROR( "USART_Read: Timed out.\n\r" ) ;
TRACE_ERROR( "USART_Read: Timed out.\r\n" ) ;
return 0;
}
timeOut--;

View File

@ -140,7 +140,7 @@ void USBD_ResetHandler()
void USBD_RequestHandler(uint8_t bEndpoint,
const USBGenericRequest* pRequest)
{
TRACE_DEBUG("%s\n\r", "USBD_RequestHandler");
TRACE_DEBUG("%s\r\n", "USBD_RequestHandler");
if (bEndpoint != 0) {
TRACE_WARNING("EP%d request not supported, default EP only",
bEndpoint);
@ -316,7 +316,7 @@ void USBD_RemoteWakeUp(void)
/* Device is NOT suspended */
if (deviceState != USBD_STATE_SUSPENDED) {
TRACE_INFO("USBD_RemoteWakeUp: Device is not suspended\n\r");
TRACE_INFO("USBD_RemoteWakeUp: Device is not suspended\r\n");
return;
}
USBD_HAL_Activate();
@ -356,7 +356,7 @@ void USBD_Disconnect(void)
*/
void USBD_Init(void)
{
TRACE_INFO_WP("USBD_Init\n\r");
TRACE_INFO_WP("USBD_Init\r\n");
/* HW Layer Initialize */
USBD_HAL_Init();
@ -367,7 +367,7 @@ void USBD_Init(void)
/* Upper Layer Initialize */
USBDCallbacks_Initialized();
TRACE_DEBUG("%s\n\r", "..");
TRACE_DEBUG("%s\r\n", "..");
}
/**

View File

@ -83,7 +83,7 @@ static void SetConfiguration(USBDDriver *pDriver, uint8_t cfgnum)
const USBConfigurationDescriptor *pConfiguration;
/* Use different descriptor depending on device speed */
TRACE_DEBUG("%s\n\r", "SetConfiguration");
TRACE_DEBUG("%s\r\n", "SetConfiguration");
if (USBD_IsHighSpeed()) {
@ -361,7 +361,7 @@ static void GetDescriptor(
default:
TRACE_WARNING(
"USBDDriver_GetDescriptor: Unknown descriptor type (%d)\n\r",
"USBDDriver_GetDescriptor: Unknown descriptor type (%d)\r\n",
type);
USBD_Stall(0);
}
@ -565,7 +565,7 @@ void USBDDriver_RequestHandler(
default:
TRACE_WARNING(
"USBDDriver_RequestHandler: Unknown recipient (%d)\n\r",
"USBDDriver_RequestHandler: Unknown recipient (%d)\r\n",
USBGenericRequest_GetRecipient(pRequest));
USBD_Stall(0);
}
@ -595,7 +595,7 @@ void USBDDriver_RequestHandler(
default:
TRACE_WARNING(
"USBDDriver_RequestHandler: Unknown feature selector (%d)\n\r",
"USBDDriver_RequestHandler: Unknown feature selector (%d)\r\n",
USBFeatureRequest_GetFeatureSelector(pRequest));
USBD_Stall(0);
}
@ -642,7 +642,7 @@ void USBDDriver_RequestHandler(
default:
TRACE_WARNING(
"USBDDriver_RequestHandler: Unknown feature selector (%d)\n\r",
"USBDDriver_RequestHandler: Unknown feature selector (%d)\r\n",
USBFeatureRequest_GetFeatureSelector(pRequest));
USBD_Stall(0);
}
@ -665,7 +665,7 @@ void USBDDriver_RequestHandler(
default:
TRACE_WARNING(
"USBDDriver_RequestHandler: Unknown request code (%d)\n\r",
"USBDDriver_RequestHandler: Unknown request code (%d)\r\n",
USBGenericRequest_GetRequest(pRequest));
USBD_Stall(0);
}

View File

@ -49,7 +49,7 @@ struct dfudata *g_dfu = &_g_dfu;
WEAK void dfu_drv_updstatus(void)
{
TRACE_INFO("DFU: updstatus()\n\r");
TRACE_INFO("DFU: updstatus()\r\n");
/* we transition immediately from MANIFEST_SYNC to MANIFEST,
* as the flash-writing is not asynchronous in this
@ -72,7 +72,7 @@ static __dfufunc void handle_getstatus(void)
dstat.iString = 0;
memcpy(&dstat.bwPollTimeout, poll_timeout_10ms, sizeof(dstat.bwPollTimeout));
TRACE_DEBUG("handle_getstatus(%u, %u)\n\r", dstat.bStatus, dstat.bState);
TRACE_DEBUG("handle_getstatus(%u, %u)\r\n", dstat.bStatus, dstat.bState);
USBD_Write(0, (char *)&dstat, sizeof(dstat), NULL, 0);
}
@ -81,7 +81,7 @@ static void __dfufunc handle_getstate(void)
{
uint8_t u8 = g_dfu->state;
TRACE_DEBUG("handle_getstate(%ld)\n\r", g_dfu->state);
TRACE_DEBUG("handle_getstate(%ld)\r\n", g_dfu->state);
USBD_Write(0, (char *)&u8, sizeof(u8), NULL, 0);
}
@ -106,10 +106,10 @@ static void dnload_cb(void *arg, unsigned char status, unsigned long int transfe
{
int rc;
TRACE_DEBUG("COMPLETE\n\r");
TRACE_DEBUG("COMPLETE\r\n");
if (status != USBD_STATUS_SUCCESS) {
TRACE_ERROR("USBD download callback status %d\n\r", status);
TRACE_ERROR("USBD download callback status %d\r\n", status);
USBD_Stall(0);
return;
}
@ -136,14 +136,14 @@ static int handle_dnload(uint16_t val, uint16_t len, int first)
int rc;
if (len > BOARD_DFU_PAGE_SIZE) {
TRACE_ERROR("DFU length exceeds flash page size\n\r");
TRACE_ERROR("DFU length exceeds flash page size\r\n");
g_dfu->state = DFU_STATE_dfuERROR;
g_dfu->status = DFU_STATUS_errADDRESS;
return DFU_RET_STALL;
}
if (len & 0x03) {
TRACE_ERROR("DFU length not four-byte-aligned\n\r");
TRACE_ERROR("DFU length not four-byte-aligned\r\n");
g_dfu->state = DFU_STATE_dfuERROR;
g_dfu->status = DFU_STATUS_errADDRESS;
return DFU_RET_STALL;
@ -153,7 +153,7 @@ static int handle_dnload(uint16_t val, uint16_t len, int first)
g_dfu->total_bytes = 0;
if (len == 0) {
TRACE_DEBUG("zero-size write -> MANIFEST_SYNC\n\r");
TRACE_DEBUG("zero-size write -> MANIFEST_SYNC\r\n");
g_dfu->state = DFU_STATE_dfuMANIFEST_SYNC;
return DFU_RET_ZLP;
}
@ -172,10 +172,10 @@ static void upload_cb(void *arg, unsigned char status, unsigned long int transfe
{
int rc;
TRACE_DEBUG("COMPLETE\n\r");
TRACE_DEBUG("COMPLETE\r\n");
if (status != USBD_STATUS_SUCCESS) {
TRACE_ERROR("USBD upload callback status %d\n\r", status);
TRACE_ERROR("USBD upload callback status %d\r\n", status);
USBD_Stall(0);
return;
}
@ -191,7 +191,7 @@ static int handle_upload(uint16_t val, uint16_t len, int first)
g_dfu->total_bytes = 0;
if (len > BOARD_DFU_PAGE_SIZE) {
TRACE_ERROR("DFU length exceeds flash page size\n\r");
TRACE_ERROR("DFU length exceeds flash page size\r\n");
g_dfu->state = DFU_STATE_dfuERROR;
g_dfu->status = DFU_STATUS_errADDRESS;
return DFU_RET_STALL;
@ -199,7 +199,7 @@ static int handle_upload(uint16_t val, uint16_t len, int first)
rc = USBDFU_handle_upload(if_altsettings[0], g_dfu->total_bytes, dfu_buf, len);
if (rc < 0) {
TRACE_ERROR("application handle_upload() returned %d\n\r", rc);
TRACE_ERROR("application handle_upload() returned %d\r\n", rc);
return DFU_RET_STALL;
}
@ -217,7 +217,7 @@ void USBDFU_DFU_RequestHandler(const USBGenericRequest *request)
uint16_t val = USBGenericRequest_GetValue(request);
int rc, ret = DFU_RET_NOTHING;
TRACE_DEBUG("type=0x%x, recipient=0x%x val=0x%x len=%u\n\r",
TRACE_DEBUG("type=0x%x, recipient=0x%x val=0x%x len=%u\r\n",
USBGenericRequest_GetType(request),
USBGenericRequest_GetRecipient(request),
val, len);

View File

@ -55,7 +55,7 @@ static __dfufunc void handle_getstatus(void)
dstat.iString = 0;
memcpy(&dstat.bwPollTimeout, poll_timeout_10ms, sizeof(dstat.bwPollTimeout));
TRACE_DEBUG("handle_getstatus(%u, %u)\n\r", dstat.bStatus, dstat.bState);
TRACE_DEBUG("handle_getstatus(%u, %u)\r\n", dstat.bStatus, dstat.bState);
USBD_Write(0, (char *)&dstat, sizeof(dstat), NULL, 0);
}
@ -64,7 +64,7 @@ static void __dfufunc handle_getstate(void)
{
uint8_t u8 = g_dfu->state;
TRACE_DEBUG("handle_getstate(%lu)\n\r", g_dfu->state);
TRACE_DEBUG("handle_getstate(%lu)\r\n", g_dfu->state);
USBD_Write(0, (char *)&u8, sizeof(u8), NULL, 0);
}
@ -110,7 +110,7 @@ void USBDFU_Runtime_RequestHandler(const USBGenericRequest *request)
uint16_t val = USBGenericRequest_GetValue(request);
int rc, ret = DFU_RET_NOTHING;
TRACE_DEBUG("type=0x%x, recipient=0x%x val=0x%x len=%u\n\r",
TRACE_DEBUG("type=0x%x, recipient=0x%x val=0x%x len=%u\r\n",
USBGenericRequest_GetType(request),
USBGenericRequest_GetRecipient(request),
val, len);
@ -159,7 +159,7 @@ void USBDFU_Runtime_RequestHandler(const USBGenericRequest *request)
/* we switch it DETACH state, send a ZLP and
* return. The next USB reset in this state
* will then trigger DFURT_SwitchToDFU() below */
TRACE_DEBUG("\r\n====dfu_detach\n\r");
TRACE_DEBUG("\r\n====dfu_detach\r\n");
g_dfu->state = DFU_STATE_appDETACH;
USBD_Write(0, 0, 0, 0, 0);
DFURT_SwitchToDFU();

View File

@ -238,7 +238,7 @@ extern void UART_DumpFrame( uint8_t* pucFrame, uint32_t dwSize )
printf( "%02X ", pucFrame[dw] ) ;
}
printf( "\n\r" ) ;
printf( "\r\n" ) ;
}
/**
@ -273,7 +273,7 @@ extern void UART_DumpMemory( uint8_t* pucBuffer, uint32_t dwSize, uint32_t dwAdd
UART_PutChar( *pucTmp++ ) ;
}
printf( "\n\r" ) ;
printf( "\r\n" ) ;
}
if ( (dwSize%16) != 0 )
@ -304,7 +304,7 @@ extern void UART_DumpMemory( uint8_t* pucBuffer, uint32_t dwSize, uint32_t dwAdd
UART_PutChar( pucBuffer[j] ) ;
}
printf( "\n\r" ) ;
printf( "\r\n" ) ;
}
}
@ -335,12 +335,12 @@ extern uint32_t UART_GetInteger( uint32_t* pdwValue )
{
if ( ucNbNb == 0 )
{
printf( "\n\rWrite a number and press ENTER or SPACE!\n\r" ) ;
printf( "\r\nWrite a number and press ENTER or SPACE!\r\n" ) ;
return 0 ;
}
else
{
printf( "\n\r" ) ;
printf( "\r\n" ) ;
*pdwValue=dwValue ;
return 1 ;
@ -348,7 +348,7 @@ extern uint32_t UART_GetInteger( uint32_t* pdwValue )
}
else
{
printf( "\n\r'%c' not a number!\n\r", ucKey ) ;
printf( "\r\n'%c' not a number!\r\n", ucKey ) ;
return 0 ;
}
@ -375,12 +375,12 @@ extern uint32_t UART_GetIntegerMinMax( uint32_t* pdwValue, uint32_t dwMin, uint3
if ( dwValue < dwMin || dwValue > dwMax )
{
printf( "\n\rThe number have to be between %d and %d\n\r", (int)dwMin, (int)dwMax ) ;
printf( "\r\nThe number have to be between %d and %d\r\n", (int)dwMin, (int)dwMax ) ;
return 0 ;
}
printf( "\n\r" ) ;
printf( "\r\n" ) ;
*pdwValue = dwValue ;
@ -421,7 +421,7 @@ extern uint32_t UART_GetHexa32( uint32_t* pdwValue )
}
else
{
printf( "\n\rIt is not a hexa character!\n\r" ) ;
printf( "\r\nIt is not a hexa character!\r\n" ) ;
return 0 ;
}
@ -429,7 +429,7 @@ extern uint32_t UART_GetHexa32( uint32_t* pdwValue )
}
}
printf("\n\r" ) ;
printf("\r\n" ) ;
*pdwValue = dwValue ;
return 1 ;

View File

@ -32,39 +32,39 @@ void board_exec_dbg_cmd(int ch)
{
switch (ch) {
case '?':
printf("\t?\thelp\n\r");
printf("\tR\treset SAM3\n\r");
printf("\tl\tswitch off LED 1\n\r");
printf("\tL\tswitch on LED 1\n\r");
printf("\tg\tswitch off LED 2\n\r");
printf("\tG\tswitch on LED 2\n\r");
printf("\t1\tGenerate 1ms reset pulse on WWAN1\n\r");
printf("\t!\tSwitch Channel A from physical -> remote\n\r");
printf("\tt\t(pseudo)talloc report\n\r");
printf("\t?\thelp\r\n");
printf("\tR\treset SAM3\r\n");
printf("\tl\tswitch off LED 1\r\n");
printf("\tL\tswitch on LED 1\r\n");
printf("\tg\tswitch off LED 2\r\n");
printf("\tG\tswitch on LED 2\r\n");
printf("\t1\tGenerate 1ms reset pulse on WWAN1\r\n");
printf("\t!\tSwitch Channel A from physical -> remote\r\n");
printf("\tt\t(pseudo)talloc report\r\n");
break;
case 'R':
printf("Asking NVIC to reset us\n\r");
printf("Asking NVIC to reset us\r\n");
USBD_Disconnect();
NVIC_SystemReset();
break;
case 'l':
led_blink(LED_GREEN, BLINK_ALWAYS_OFF);
printf("LED 1 switched off\n\r");
printf("LED 1 switched off\r\n");
break;
case 'L':
led_blink(LED_GREEN, BLINK_ALWAYS_ON);
printf("LED 1 switched on\n\r");
printf("LED 1 switched on\r\n");
break;
case 'g':
led_blink(LED_RED, BLINK_ALWAYS_OFF);
printf("LED 2 switched off\n\r");
printf("LED 2 switched off\r\n");
break;
case 'G':
led_blink(LED_RED, BLINK_ALWAYS_ON);
printf("LED 2 switched on\n\r");
printf("LED 2 switched on\r\n");
break;
case '1':
printf("Resetting Modem\n\r");
printf("Resetting Modem\r\n");
wwan_perst_do_reset_pulse(0, 300);
break;
case '!':
@ -74,7 +74,7 @@ void board_exec_dbg_cmd(int ch)
talloc_report(NULL, stdout);
break;
default:
printf("Unknown command '%c'\n\r", ch);
printf("Unknown command '%c'\r\n", ch);
break;
}
}

View File

@ -37,7 +37,7 @@ int sim_switch_use_physical(unsigned int nr, int physical)
sim_switch_init();
}
TRACE_INFO("Modem %d: %s SIM\n\r", nr,
TRACE_INFO("Modem %d: %s SIM\r\n", nr,
physical ? "physical" : "virtual");
switch (nr) {
@ -46,7 +46,7 @@ int sim_switch_use_physical(unsigned int nr, int physical)
break;
default:
TRACE_ERROR("Invalid SIM%u\n\r", nr);
TRACE_ERROR("Invalid SIM%u\r\n", nr);
return -1;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -25,16 +25,16 @@ void board_exec_dbg_cmd(int ch)