mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Remove all printf() statements from Kinetis demo as they prevent the code running when the debugger is not attached.
This commit is contained in:
parent
7db04b1820
commit
000b4ba783
|
@ -78,12 +78,6 @@ void enable_irq (int irq)
|
|||
{
|
||||
int div;
|
||||
|
||||
/* Make sure that the IRQ is an allowable number. Right now up to 91 is
|
||||
* used.
|
||||
*/
|
||||
if (irq > 91)
|
||||
printf("\nERR! Invalid IRQ value passed to enable irq function!\n");
|
||||
|
||||
/* Determine which of the NVICISERs corresponds to the irq */
|
||||
div = irq/32;
|
||||
|
||||
|
@ -119,12 +113,6 @@ void disable_irq (int irq)
|
|||
{
|
||||
int div;
|
||||
|
||||
/* Make sure that the IRQ is an allowable number. Right now up to 91 is
|
||||
* used.
|
||||
*/
|
||||
if (irq > 91)
|
||||
printf("\nERR! Invalid IRQ value passed to disable irq function!\n");
|
||||
|
||||
/* Determine which of the NVICICERs corresponds to the irq */
|
||||
div = irq/32;
|
||||
|
||||
|
@ -159,15 +147,6 @@ void set_irq_priority (int irq, int prio)
|
|||
/*irq priority pointer*/
|
||||
uint8 *prio_reg;
|
||||
|
||||
/* Make sure that the IRQ is an allowable number. Right now up to 91 is
|
||||
* used.
|
||||
*/
|
||||
if (irq > 91)
|
||||
printf("\nERR! Invalid IRQ value passed to priority irq function!\n");
|
||||
|
||||
if (prio > 15)
|
||||
printf("\nERR! Invalid priority value passed to priority irq function!\n");
|
||||
|
||||
/* Determine which of the NVICIPx corresponds to the irq */
|
||||
prio_reg = (uint8 *)(((uint32)&NVICIP0) + irq);
|
||||
/* Assign priority to IRQ */
|
||||
|
|
|
@ -29,33 +29,9 @@ void start(void)
|
|||
/* Perform processor initialization */
|
||||
sysinit();
|
||||
|
||||
printf("\n\n");
|
||||
|
||||
/* Determine the last cause(s) of reset */
|
||||
if (MC_SRSH & MC_SRSH_SW_MASK)
|
||||
printf("Software Reset\n");
|
||||
if (MC_SRSH & MC_SRSH_LOCKUP_MASK)
|
||||
printf("Core Lockup Event Reset\n");
|
||||
if (MC_SRSH & MC_SRSH_JTAG_MASK)
|
||||
printf("JTAG Reset\n");
|
||||
|
||||
if (MC_SRSL & MC_SRSL_POR_MASK)
|
||||
printf("Power-on Reset\n");
|
||||
if (MC_SRSL & MC_SRSL_PIN_MASK)
|
||||
printf("External Pin Reset\n");
|
||||
if (MC_SRSL & MC_SRSL_COP_MASK)
|
||||
printf("Watchdog(COP) Reset\n");
|
||||
if (MC_SRSL & MC_SRSL_LOC_MASK)
|
||||
printf("Loss of Clock Reset\n");
|
||||
if (MC_SRSL & MC_SRSL_LVD_MASK)
|
||||
printf("Low-voltage Detect Reset\n");
|
||||
if (MC_SRSL & MC_SRSL_WAKEUP_MASK)
|
||||
printf("LLWU Reset\n");
|
||||
|
||||
/* Determine the flash revision */
|
||||
flash_identify();
|
||||
|
||||
/* Determine specific Kinetis device and revision */
|
||||
cpu_identify();
|
||||
|
||||
/* Jump to main process */
|
||||
main();
|
||||
|
||||
|
@ -63,168 +39,6 @@ void start(void)
|
|||
while(1);
|
||||
}
|
||||
/********************************************************************/
|
||||
/*!
|
||||
* \brief Kinetis Identify
|
||||
* \return None
|
||||
*
|
||||
* This is primarly a reporting function that displays information
|
||||
* about the specific CPU to the default terminal including:
|
||||
* - Kinetis family
|
||||
* - package
|
||||
* - die revision
|
||||
* - P-flash size
|
||||
* - Ram size
|
||||
*/
|
||||
void cpu_identify (void)
|
||||
{
|
||||
/* Determine the Kinetis family */
|
||||
switch((SIM_SDID & SIM_SDID_FAMID(0x7))>>SIM_SDID_FAMID_SHIFT)
|
||||
{
|
||||
case 0x0:
|
||||
printf("\nK10-");
|
||||
break;
|
||||
case 0x1:
|
||||
printf("\nK20-");
|
||||
break;
|
||||
case 0x2:
|
||||
printf("\nK30-");
|
||||
break;
|
||||
case 0x3:
|
||||
printf("\nK40-");
|
||||
break;
|
||||
case 0x4:
|
||||
printf("\nK60-");
|
||||
break;
|
||||
case 0x5:
|
||||
printf("\nK70-");
|
||||
break;
|
||||
case 0x6:
|
||||
printf("\nK50-");
|
||||
break;
|
||||
case 0x7:
|
||||
printf("\nK53-");
|
||||
break;
|
||||
default:
|
||||
printf("\nUnrecognized Kinetis family device.\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Determine the package size */
|
||||
switch((SIM_SDID & SIM_SDID_PINID(0xF))>>SIM_SDID_PINID_SHIFT)
|
||||
{
|
||||
case 0x2:
|
||||
printf("32pin ");
|
||||
break;
|
||||
case 0x4:
|
||||
printf("48pin ");
|
||||
break;
|
||||
case 0x5:
|
||||
printf("64pin ");
|
||||
break;
|
||||
case 0x6:
|
||||
printf("80pin ");
|
||||
break;
|
||||
case 0x7:
|
||||
printf("81pin ");
|
||||
break;
|
||||
case 0x8:
|
||||
printf("100pin ");
|
||||
break;
|
||||
case 0x9:
|
||||
printf("104pin ");
|
||||
break;
|
||||
case 0xA:
|
||||
printf("144pin ");
|
||||
break;
|
||||
case 0xC:
|
||||
printf("196pin ");
|
||||
break;
|
||||
case 0xE:
|
||||
printf("256pin ");
|
||||
break;
|
||||
default:
|
||||
printf("\nUnrecognized Kinetis package code. ");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Determine the revision ID */
|
||||
printf("Silicon rev %d \n", (SIM_SDID & SIM_SDID_REVID(0xF))>>SIM_SDID_REVID_SHIFT);
|
||||
|
||||
|
||||
/* Determine the flash revision */
|
||||
flash_identify();
|
||||
|
||||
/* Determine the P-flash size */
|
||||
switch((SIM_FCFG1 & SIM_FCFG1_FSIZE(0xFF))>>SIM_FCFG1_FSIZE_SHIFT)
|
||||
{
|
||||
case 0x0:
|
||||
printf("12 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x1:
|
||||
printf("16 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x2:
|
||||
printf("32 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x3:
|
||||
printf("48 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x4:
|
||||
printf("64 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x5:
|
||||
printf("96 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x6:
|
||||
printf("128 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x7:
|
||||
printf("192 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x8:
|
||||
printf("256 kBytes of P-flash ");
|
||||
break;
|
||||
case 0x9:
|
||||
printf("320 kBytes of P-flash ");
|
||||
break;
|
||||
case 0xA:
|
||||
printf("384 kBytes of P-flash ");
|
||||
break;
|
||||
case 0xB:
|
||||
printf("448 kBytes of P-flash ");
|
||||
break;
|
||||
case 0xC:
|
||||
printf("512 kBytes of P-flash ");
|
||||
break;
|
||||
case 0xFF:
|
||||
printf("Full size P-flash ");
|
||||
break;
|
||||
default:
|
||||
printf("ERR!! Undefined P-flash size\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Determine the RAM size */
|
||||
switch((SIM_SOPT1 & SIM_SOPT1_RAMSIZE(0xF))>>SIM_SOPT1_RAMSIZE_SHIFT)
|
||||
{
|
||||
case 0x5:
|
||||
printf(" 32 kBytes of RAM\n\n");
|
||||
break;
|
||||
case 0x7:
|
||||
printf(" 64 kBytes of RAM\n\n");
|
||||
break;
|
||||
case 0x8:
|
||||
printf(" 96 kBytes of RAM\n\n");
|
||||
break;
|
||||
case 0x9:
|
||||
printf(" 128 kBytes of RAM\n\n");
|
||||
break;
|
||||
default:
|
||||
printf(" ERR!! Undefined RAM size\n\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
/********************************************************************/
|
||||
/*!
|
||||
* \brief flash Identify
|
||||
* \return None
|
||||
|
@ -253,8 +67,6 @@ void flash_identify (void)
|
|||
/* Wait for the command to complete */
|
||||
while(!(FTFL_FSTAT & FTFL_FSTAT_CCIF_MASK));
|
||||
|
||||
printf("Flash parameter version %d.%d.%d.%d\n",FTFL_FCCOB4,FTFL_FCCOB5,FTFL_FCCOB6,FTFL_FCCOB7);
|
||||
|
||||
/* Get the flash version ID */
|
||||
|
||||
/* Write the flash FCCOB registers with the values for a read resource command */
|
||||
|
@ -269,8 +81,6 @@ void flash_identify (void)
|
|||
|
||||
/* Wait for the command to complete */
|
||||
while(!(FTFL_FSTAT & FTFL_FSTAT_CCIF_MASK));
|
||||
|
||||
printf("Flash version ID %d.%d.%d.%d\n",FTFL_FCCOB4,FTFL_FCCOB5,FTFL_FCCOB6,FTFL_FCCOB7);
|
||||
}
|
||||
/********************************************************************/
|
||||
|
||||
|
|
|
@ -300,10 +300,7 @@ typedef void (*vector_entry)(void);
|
|||
|
||||
void default_isr(void)
|
||||
{
|
||||
#define VECTORNUM (*(volatile uint8_t*)(0xE000ED04))
|
||||
|
||||
printf("\n****default_isr entered on vector %d*****\r\n\n",VECTORNUM);
|
||||
return;
|
||||
for( ;; );
|
||||
}
|
||||
/******************************************************************************/
|
||||
/* End of "vectors.c" */
|
||||
|
|
|
@ -397,17 +397,10 @@ eth_phy_reg_dump(int ch, int phy_addr)
|
|||
{
|
||||
int j, settings;
|
||||
|
||||
printf("\n MII Register Block\n");
|
||||
printf("--------------------------------");
|
||||
for (j = 0; j < 32; j++)
|
||||
{
|
||||
mii_read(ch, phy_addr, j, &settings);
|
||||
if (!(j % 4))
|
||||
printf("\n0x%02X-0x%02X : %04X ", j, j + 3, settings);
|
||||
else
|
||||
printf("%04X ", settings);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -389,7 +389,6 @@ static long lChangedTimerPeriodAlready = pdFALSE;
|
|||
if( lChangedTimerPeriodAlready == pdFALSE )
|
||||
{
|
||||
lChangedTimerPeriodAlready = pdTRUE;
|
||||
printf( "%s", pcStatusMessage );
|
||||
|
||||
/* This call to xTimerChangePeriod() uses a zero block time.
|
||||
Functions called from inside of a timer callback function must
|
||||
|
@ -561,7 +560,6 @@ volatile size_t xFreeHeapSpace;
|
|||
xTimerStart( xLED2Timer, portMAX_DELAY );
|
||||
|
||||
xFreeHeapSpace = xPortGetFreeHeapSize();
|
||||
printf( "%d bytes of FreeRTOS heap remain unused\nconfigTOTAL_HEAP_SIZE can be reduced\n", xFreeHeapSpace );
|
||||
|
||||
if( xFreeHeapSpace > 100 )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue