mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-09-09 23:54:32 +00:00
Merge pull request #641 from hexluthor/backdoor-conf
CC2538: Add CONF parameters to select boot loader backdoor pin and logic level
This commit is contained in:
commit
eabc244bff
@ -48,7 +48,16 @@ typedef uint32_t rtimer_clock_t;
|
|||||||
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR
|
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR
|
||||||
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
|
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN
|
||||||
|
#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_ACTIVE_HIGH
|
||||||
|
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH 0 /**< A logic low level activates the boot loader */
|
||||||
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* \name Flash Memory configuration
|
* \name Flash Memory configuration
|
||||||
|
@ -65,9 +65,21 @@ void udma_err_isr(void);
|
|||||||
|
|
||||||
/* Boot Loader Backdoor selection */
|
/* Boot Loader Backdoor selection */
|
||||||
#if FLASH_CCA_CONF_BOOTLDR_BACKDOOR
|
#if FLASH_CCA_CONF_BOOTLDR_BACKDOOR
|
||||||
/* Backdoor enabled, on PA_3 (Select button) */
|
/* Backdoor enabled */
|
||||||
|
|
||||||
|
#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) )
|
||||||
|
#error Invalid boot loader backdoor pin. Please set FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN between 0 and 7 (indicating PA0 - PA7).
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FLASH_CCA_BOOTLDR_CFG ( FLASH_CCA_BOOTLDR_CFG_ENABLE \
|
#define FLASH_CCA_BOOTLDR_CFG ( FLASH_CCA_BOOTLDR_CFG_ENABLE \
|
||||||
| ((3 << FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_S) & FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_M))
|
| FLASH_CCA_BOOTLDR_CFG_ACTIVE_LEVEL \
|
||||||
|
| (FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN << FLASH_CCA_BOOTLDR_CFG_PORT_A_PIN_S) )
|
||||||
#else
|
#else
|
||||||
#define FLASH_CCA_BOOTLDR_CFG FLASH_CCA_BOOTLDR_CFG_DISABLE
|
#define FLASH_CCA_BOOTLDR_CFG FLASH_CCA_BOOTLDR_CFG_DISABLE
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user