From 22fb92f9c869c144eb2d8475fc735df6c74248a6 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 21 Oct 2018 19:51:22 +0200 Subject: [PATCH] sugar --- armsrc/flashmem.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/armsrc/flashmem.c b/armsrc/flashmem.c index 3a46500ba..92204baff 100644 --- a/armsrc/flashmem.c +++ b/armsrc/flashmem.c @@ -254,12 +254,7 @@ uint16_t Flash_ReadData(uint32_t address, uint8_t *out, uint16_t len) { // length should never be zero if (!len || Flash_CheckBusy(BUSY_TIMEOUT)) return 0; - - uint8_t cmd = READDATA; - - if(FASTFLASH) { - cmd = FASTREAD; - } + uint8_t cmd = (FASTFLASH) ? FASTREAD : READDATA; FlashSendByte(cmd); Flash_TransferAdresse(address); @@ -273,8 +268,6 @@ uint16_t Flash_ReadData(uint32_t address, uint8_t *out, uint16_t len) { out[i] = FlashSendByte(0xFF); out[i] = FlashSendLastByte(0xFF); - - FlashStop(); return len; } @@ -291,11 +284,7 @@ uint16_t Flash_ReadDataCont(uint32_t address, uint8_t *out, uint16_t len) { // length should never be zero if (!len) return 0; - uint8_t cmd = READDATA; - - if(FASTFLASH) { - cmd = FASTREAD; - } + uint8_t cmd = (FASTFLASH) ? FASTREAD : READDATA; FlashSendByte(cmd); Flash_TransferAdresse(address); @@ -309,7 +298,6 @@ uint16_t Flash_ReadDataCont(uint32_t address, uint8_t *out, uint16_t len) { out[i] = FlashSendByte(0xFF); out[i] = FlashSendLastByte(0xFF); - return len; }