aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c')
-rw-r--r--os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c b/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c
index b37c026..f39ff35 100644
--- a/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c
+++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c
@@ -15,7 +15,7 @@
*/
/**
- * @file nand_lld.c
+ * @file hal_nand_lld.c
* @brief NAND Driver subsystem low level driver source.
*
* @addtogroup NAND
@@ -117,13 +117,10 @@ static uint32_t calc_eccps(NANDDriver *nandp) {
* @notapi
*/
static void nand_ready_isr_enable(NANDDriver *nandp) {
-#if STM32_NAND_USE_EXT_INT
- nandp->config->ext_nand_isr_enable();
-#else
+
nandp->nand->SR &= ~(FSMC_SR_IRS | FSMC_SR_ILS | FSMC_SR_IFS |
- FSMC_SR_ILEN | FSMC_SR_IFEN);
+ FSMC_SR_ILEN | FSMC_SR_IFEN);
nandp->nand->SR |= FSMC_SR_IREN;
-#endif
}
/**
@@ -134,11 +131,8 @@ static void nand_ready_isr_enable(NANDDriver *nandp) {
* @notapi
*/
static void nand_ready_isr_disable(NANDDriver *nandp) {
-#if STM32_NAND_USE_EXT_INT
- nandp->config->ext_nand_isr_disable();
-#else
+
nandp->nand->SR &= ~FSMC_SR_IREN;
-#endif
}
/**
@@ -152,10 +146,8 @@ static void nand_isr_handler (NANDDriver *nandp) {
osalSysLockFromISR();
-#if !STM32_NAND_USE_EXT_INT
osalDbgCheck(nandp->nand->SR & FSMC_SR_IRS); /* spurious interrupt happened */
nandp->nand->SR &= ~FSMC_SR_IRS;
-#endif
switch (nandp->state){
case NAND_READ:
@@ -501,12 +493,13 @@ void nand_lld_write_cmd(NANDDriver *nandp, uint8_t cmd) {
*/
uint8_t nand_lld_read_status(NANDDriver *nandp) {
- uint8_t status[1] = {0x01}; /* presume worse */
+ uint8_t status;
+ status = 1; /* presume worse */
nand_lld_write_cmd(nandp, NAND_CMD_STATUS);
- nand_lld_polled_read_data(nandp, status, 1);
+ nand_lld_polled_read_data(nandp, &status, 1);
- return status[0];
+ return status;
}
#endif /* HAL_USE_NAND */