Fixed wrong management of board_init for non secure HAL

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10625 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Rocco Marco Guglielmi 2017-09-17 18:01:09 +00:00
parent b64207597a
commit c1f1faa85b
1 changed files with 10 additions and 1 deletions

View File

@ -152,7 +152,6 @@ void boardInit(void) {
while (sama_inits[i].pio_id != -1) {
#if SAMA_HAL_IS_SECURE
PIOA->PIO_PIO_[sama_inits[i].pio_id].S_PIO_SIOSR = sama_inits[i].pio_msk;
#endif /* SAMA_HAL_IS_SECURE */
PIOA->PIO_PIO_[sama_inits[i].pio_id].S_PIO_MSKR = sama_inits[i].pio_msk;
PIOA->PIO_PIO_[sama_inits[i].pio_id].S_PIO_CFGR = sama_inits[i].pio_cfg;
if(sama_inits[i].pio_ods == SAMA_PIO_HIGH) {
@ -161,6 +160,16 @@ void boardInit(void) {
else {
PIOA->PIO_PIO_[sama_inits[i].pio_id].S_PIO_CODR = sama_inits[i].pio_msk;
}
#else
PIOA->PIO_IO_GROUP[sama_inits[i].pio_id].PIO_MSKR = sama_inits[i].pio_msk;
PIOA->PIO_IO_GROUP[sama_inits[i].pio_id].PIO_CFGR = sama_inits[i].pio_cfg;
if(sama_inits[i].pio_ods == SAMA_PIO_HIGH) {
PIOA->PIO_IO_GROUP[sama_inits[i].pio_id].PIO_SODR = sama_inits[i].pio_msk;
}
else {
PIOA->PIO_IO_GROUP[sama_inits[i].pio_id].PIO_CODR = sama_inits[i].pio_msk;
}
#endif /* SAMA_HAL_IS_SECURE */
i++;
}
}