From b318c5b6a50602adf5c84abe6e1433817273987d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 8 Jun 2013 13:50:42 -0600 Subject: [PATCH] SAM3U/4L changes to hide differences by clocking in those MCUs --- configs/sam4l-xplained/ostest/defconfig | 1 + configs/sam4l-xplained/src/sam4l-xplained.h | 2 +- configs/sam4l-xplained/src/sam_autoleds.c | 36 ++++++++++----------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/configs/sam4l-xplained/ostest/defconfig b/configs/sam4l-xplained/ostest/defconfig index fdc5a3039d..820b60ba69 100644 --- a/configs/sam4l-xplained/ostest/defconfig +++ b/configs/sam4l-xplained/ostest/defconfig @@ -165,6 +165,7 @@ CONFIG_SAM34_USART1=y # CONFIG_SAM34_AST is not set # CONFIG_SAM34_WDT is not set # CONFIG_SAM34_EIC is not set +# CONFIG_SAM32_RESET_PERIPHCLKS is not set # # AT91SAM3/4 USART Configuration diff --git a/configs/sam4l-xplained/src/sam4l-xplained.h b/configs/sam4l-xplained/src/sam4l-xplained.h index 9f7904327c..80a03b1688 100644 --- a/configs/sam4l-xplained/src/sam4l-xplained.h +++ b/configs/sam4l-xplained/src/sam4l-xplained.h @@ -80,7 +80,7 @@ * 2Hz, then a fatal error has been detected and the system has halted. */ -#define GPIO_LED0 (GPIO_OUTPUT | GPIO_PULL_NONE GPIO_OUTPUT_SET | \ +#define GPIO_LED0 (GPIO_OUTPUT | GPIO_PULL_NONE | GPIO_OUTPUT_SET | \ GPIO_PORTC | GPIO_PIN7) /* QTouch button: The SAM4L Xplained Pro kit has one QTouch button. The connection diff --git a/configs/sam4l-xplained/src/sam_autoleds.c b/configs/sam4l-xplained/src/sam_autoleds.c index 09b673a966..06d647b63f 100644 --- a/configs/sam4l-xplained/src/sam_autoleds.c +++ b/configs/sam4l-xplained/src/sam_autoleds.c @@ -123,19 +123,19 @@ void up_ledon(int led) switch (led) { - case LED_STARTED : /* NuttX has been started LED0=OFF */ - case LED_HEAPALLOCATE: /* Heap has been allocated LED0=OFF */ - case LED_IRQSENABLED: /* Interrupts enabled LED0=OFF */ + case 0: /* LED_STARTED: NuttX has been started LED0=OFF */ + /* LED_HEAPALLOCATE: Heap has been allocated LED0=OFF */ + /* LED_IRQSENABLED: Interrupts enabled LED0=OFF */ break; /* Leave ledstate == true to turn OFF */ default: - case LED_INIRQ: /* In an interrupt LED0=N/C */ - case LED_SIGNAL: /* In a signal handler LED0=N/C */ - case LED_ASSERTION: /* An assertion failed LED0=N/C */ - return; + case 2: /* LED_INIRQ: In an interrupt LED0=N/C */ + /* LED_SIGNAL: In a signal handler LED0=N/C */ + /* LED_ASSERTION: An assertion failed LED0=N/C */ + return; /* Return to leave LED0 unchanged */ - case LED_PANIC: /* The system has crashed LED0=FLASH */ - case LED_STACKCREATED: /* Idle stack created LED0=ON */ + case 3: /* LED_PANIC: The system has crashed LED0=FLASH */ + case 1: /* LED_STACKCREATED: Idle stack created LED0=ON */ ledstate = false; /* Set ledstate == false to turn ON */ break; } @@ -154,21 +154,21 @@ void up_ledoff(int led) /* These should not happen and are ignored */ default: - case LED_STARTED : /* NuttX has been started LED0=OFF */ - case LED_HEAPALLOCATE: /* Heap has been allocated LED0=OFF */ - case LED_IRQSENABLED: /* Interrupts enabled LED0=OFF */ - case LED_STACKCREATED: /* Idle stack created LED0=ON */ + case 0: /* LED_STARTED: NuttX has been started LED0=OFF */ + /* LED_HEAPALLOCATE: Heap has been allocated LED0=OFF */ + /* LED_IRQSENABLED: Interrupts enabled LED0=OFF */ + case 1: /* LED_STACKCREATED: Idle stack created LED0=ON */ /* These result in no-change */ - case LED_INIRQ: /* In an interrupt LED0=N/C */ - case LED_SIGNAL: /* In a signal handler LED0=N/C */ - case LED_ASSERTION: /* An assertion failed LED0=N/C */ - return; + case 2: /* LED_INIRQ: In an interrupt LED0=N/C */ + /* LED_SIGNAL: In a signal handler LED0=N/C */ + /* LED_ASSERTION: An assertion failed LED0=N/C */ + return; /* Return to leave LED0 unchanged */ /* Turn LED0 off set driving the output high */ - case LED_PANIC: /* The system has crashed LED0=FLASH */ + case 3: /* LED_PANIC: The system has crashed LED0=FLASH */ sam_gpiowrite(GPIO_LED0, true); break; }