Changes suggested by @bthebaudeau.

This commit is contained in:
Ian Martin 2014-04-18 10:29:47 -04:00
parent 2cf730a1c6
commit ee05810904
3 changed files with 7 additions and 6 deletions

View file

@ -58,7 +58,6 @@
#define FLASH_CCA_BOOTLDR_CFG_ACTIVE_HIGH 0x08000000 /**< Selected pin on pad A active high */
#define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_M 0x07000000 /**< Selected pin on pad A mask */
#define FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_S 24 /**< Selected pin on pad A shift */
#define FLASH_CCA_BOOTLDR_CFG_PORT_A_LEVEL_S 27 /**< Pin level shift */
/** @} */
/*---------------------------------------------------------------------------*/
/** \name Image valid definitions

View file

@ -53,8 +53,8 @@ typedef uint32_t rtimer_clock_t;
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN 3 /**< Pin PA_3 (Select button) activates the boot loader */
#endif
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_LEVEL
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_LEVEL 0 /**< A logic low level activates the boot loader */
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH 0 /**< A logic low level activates the boot loader */
#endif
/** @} */

View file

@ -67,8 +67,10 @@ void udma_err_isr(void);
#if FLASH_CCA_CONF_BOOTLDR_BACKDOOR
/* Backdoor enabled */
#if ( (FLASH_CCA_CONF_BOOTLDR_BACKDOOR_LEVEL < 0) || (FLASH_CCA_CONF_BOOTLDR_BACKDOOR_LEVEL > 1) )
#error Invalid boot loader backdoor pin level. Please set FLASH_CCA_CONF_BOOTLDR_BACKDOOR_LEVEL to 0 (logic low) or 1 (logic high).
#if FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH
#define FLASH_CCA_BOOTLDR_CFG_ACTIVE_LEVEL FLASH_CCA_BOOTLDR_CFG_ACTIVE_HIGH
#else
#define FLASH_CCA_BOOTLDR_CFG_ACTIVE_LEVEL 0
#endif
#if ( (FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN < 0) || (FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN > 7) )
@ -76,7 +78,7 @@ void udma_err_isr(void);
#endif
#define FLASH_CCA_BOOTLDR_CFG ( FLASH_CCA_BOOTLDR_CFG_ENABLE \
| (FLASH_CCA_CONF_BOOTLDR_BACKDOOR_LEVEL << FLASH_CCA_BOOTLDR_CFG_PORT_A_LEVEL_S) \
| FLASH_CCA_BOOTLDR_CFG_ACTIVE_LEVEL \
| (FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN << FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_S) )
#else
#define FLASH_CCA_BOOTLDR_CFG FLASH_CCA_BOOTLDR_CFG_DISABLE