diff options
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/platforms/AT91SAM7/pal_lld.c | 6 | ||||
-rw-r--r-- | os/hal/platforms/AT91SAM7/pal_lld.h | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/os/hal/platforms/AT91SAM7/pal_lld.c b/os/hal/platforms/AT91SAM7/pal_lld.c index 9545c976c..9ad9a02f5 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.c +++ b/os/hal/platforms/AT91SAM7/pal_lld.c @@ -38,7 +38,8 @@ void _pal_lld_init(const AT91SAM7PIOConfig *config) {
unsigned int ports = (1 << AT91C_ID_PIOA);
-#if defined(SAM7X128) || defined(SAM7X256) || defined(SAM7X512)
+#if (SAM7_PLATFORM == SAM7X128) || (SAM7_PLATFORM == SAM7X256) || \
+ (SAM7_PLATFORM == SAM7X256)
ports |= (1 << AT91C_ID_PIOB);
#endif
AT91C_BASE_PMC->PMC_PCER = ports;
@@ -61,7 +62,8 @@ void _pal_lld_init(const AT91SAM7PIOConfig *config) { /*
* PIOB setup.
*/
-#if defined(SAM7X128) || defined(SAM7X256) || defined(SAM7X512)
+#if (SAM7_PLATFORM == SAM7X128) || (SAM7_PLATFORM == SAM7X256) || \
+ (SAM7_PLATFORM == SAM7X256)
AT91C_BASE_PIOB->PIO_PPUER = config->P1Data.pusr; /* Pull-up as spec.*/
AT91C_BASE_PIOB->PIO_PPUDR = ~config->P1Data.pusr;
AT91C_BASE_PIOB->PIO_PER = 0xFFFFFFFF; /* PIO enabled.*/
diff --git a/os/hal/platforms/AT91SAM7/pal_lld.h b/os/hal/platforms/AT91SAM7/pal_lld.h index 950f3a52f..e2c836818 100644 --- a/os/hal/platforms/AT91SAM7/pal_lld.h +++ b/os/hal/platforms/AT91SAM7/pal_lld.h @@ -61,8 +61,8 @@ typedef struct { typedef struct {
/** @brief Port 0 setup data.*/
at91sam7_pio_setup_t P0Data;
-#if defined(SAM7X128) || defined(SAM7X256) || defined(SAM7X512) || \
- defined(__DOXYGEN__)
+#if (SAM7_PLATFORM == SAM7X128) || (SAM7_PLATFORM == SAM7X256) || \
+ (SAM7_PLATFORM == SAM7X256) || defined(__DOXYGEN__)
/** @brief Port 1 setup data.*/
at91sam7_pio_setup_t P1Data;
#endif
@@ -98,8 +98,8 @@ typedef AT91PS_PIO ioportid_t; /**
* @brief PIO port B identifier.
*/
-#if defined(SAM7X128) || defined(SAM7X256) || defined(SAM7X512) || \
- defined(__DOXYGEN__)
+#if (SAM7_PLATFORM == SAM7X128) || (SAM7_PLATFORM == SAM7X256) || \
+ (SAM7_PLATFORM == SAM7X256) || defined(__DOXYGEN__)
#define IOPORT2 AT91C_BASE_PIOB
#endif
|