Mercurial > ecos
changeset 2636:08f6d3cdcc55
* include/var_io.h: Changed CYGHWR_HAL_STM32_BD_UNPROTECT to
CYGHWR_HAL_STM32_BD_PROTECT, inverting the argument.
* src/stm32_misc.c: Changed hal_stm32_bd_unprotect() to
hal_stm32_bd_protect(), inverting the argument.
| author | nickg |
|---|---|
| date | Wed, 19 Nov 2008 17:46:49 +0000 |
| parents | 8f706d6bdc35 |
| children | 980a3c2c5430 |
| files | packages/hal/cortexm/stm32/var/current/ChangeLog packages/hal/cortexm/stm32/var/current/include/var_io.h packages/hal/cortexm/stm32/var/current/src/stm32_misc.c |
| diffstat | 3 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/packages/hal/cortexm/stm32/var/current/ChangeLog +++ b/packages/hal/cortexm/stm32/var/current/ChangeLog @@ -1,3 +1,10 @@ +2008-11-12 Simon Kallweit <simon.kallweit@intefo.ch> + + * include/var_io.h: Changed CYGHWR_HAL_STM32_BD_UNPROTECT to + CYGHWR_HAL_STM32_BD_PROTECT, inverting the argument. + * src/stm32_misc.c: Changed hal_stm32_bd_unprotect() to + hal_stm32_bd_protect(), inverting the argument. + 2008-11-11 Nick Garnett <nickg@ecoscentric.com> * include/var_io.h: Add power control definitions.
--- a/packages/hal/cortexm/stm32/var/current/include/var_io.h +++ b/packages/hal/cortexm/stm32/var/current/include/var_io.h @@ -591,7 +591,7 @@ // Functions and macros to reset the backup domain as well as // enable/disable backup domain write protection. -__externC void hal_stm32_bd_unprotect( int disable ); +__externC void hal_stm32_bd_protect( int protect ); #define CYGHWR_HAL_STM32_BD_RESET() \ CYG_MACRO_START \ @@ -600,8 +600,8 @@ HAL_WRITE_UINT32(CYGHWR_HAL_STM32_RCC+CYGHWR_HAL_STM32_RCC_BDCR, 0); \ CYG_MACRO_END -#define CYGHWR_HAL_STM32_BD_UNPROTECT(__unprotect ) \ - hal_stm32_bd_unprotect( __unprotect ) +#define CYGHWR_HAL_STM32_BD_PROTECT(__protect ) \ + hal_stm32_bd_protect( __protect ) //============================================================================= // FSMC
--- a/packages/hal/cortexm/stm32/var/current/src/stm32_misc.c +++ b/packages/hal/cortexm/stm32/var/current/src/stm32_misc.c @@ -312,16 +312,17 @@ cyg_uint32 hal_exti_isr( cyg_uint32 vect //========================================================================== // Backup domain -void hal_stm32_bd_unprotect( int unprotect ) +void hal_stm32_bd_protect( int protect ) { CYG_ADDRESS pwr = CYGHWR_HAL_STM32_PWR; cyg_uint32 cr; HAL_READ_UINT32( pwr+CYGHWR_HAL_STM32_PWR_CR, cr ); - if( unprotect ) - cr |= CYGHWR_HAL_STM32_PWR_CR_DBP; + if( protect ) + cr &= ~CYGHWR_HAL_STM32_PWR_CR_DBP; else - cr &= ~CYGHWR_HAL_STM32_PWR_CR_DBP; + cr |= CYGHWR_HAL_STM32_PWR_CR_DBP; + HAL_WRITE_UINT32( pwr+CYGHWR_HAL_STM32_PWR_CR, cr ); }
