Dont cache dma buffers (#1110)
* add no_cache * don't disable cache * conventions * formatting
This commit is contained in:
parent
4dd9edfcff
commit
c51f3ad303
|
@ -77,8 +77,10 @@ typedef unsigned int time_t;
|
|||
*/
|
||||
#if defined(STM32F7XX)
|
||||
#define CCM_RAM ".ram3"
|
||||
#define NO_CACHE CCM_OPTIONAL
|
||||
#else /* defined(STM32F4XX) */
|
||||
#define CCM_RAM ".ram4"
|
||||
#define NO_CACHE
|
||||
#endif /* defined(STM32F4XX) */
|
||||
|
||||
#if EFI_USE_CCM
|
||||
|
|
|
@ -121,8 +121,8 @@ static void printError(const char *str, FRESULT f_error) {
|
|||
scheduleMsg(&logger, "FATfs Error \"%s\" %d", str, f_error);
|
||||
}
|
||||
|
||||
static FIL FDLogFile;
|
||||
static FIL FDCurrFile;
|
||||
static FIL FDLogFile NO_CACHE;
|
||||
static FIL FDCurrFile NO_CACHE;
|
||||
static int logFileIndex = 1;
|
||||
static char logName[_MAX_FILLER + 20];
|
||||
|
||||
|
|
|
@ -80,9 +80,6 @@ void baseMCUInit(void) {
|
|||
DWT->CYCCNT = 0;
|
||||
|
||||
BOR_Set(BOR_Level_1); // one step above default value
|
||||
|
||||
// open question if we need this or not
|
||||
// SCB_DisableDCache();
|
||||
}
|
||||
|
||||
void _unhandled_exception(void) {
|
||||
|
|
|
@ -29,12 +29,9 @@ EXTERN_ENGINE;
|
|||
#include "pin_repository.h"
|
||||
|
||||
static Logging *logger;
|
||||
/**
|
||||
* We need to make sure we do not get F7 SPI DMA caching issues
|
||||
* We also have "SCB_DisableDCache();" which is about the same since we need DMA SPI addressed not only for cj125
|
||||
*/
|
||||
static unsigned char tx_buff[2] CCM_OPTIONAL;
|
||||
static unsigned char rx_buff[1] CCM_OPTIONAL;
|
||||
|
||||
static uint8_t tx_buff[2] NO_CACHE;
|
||||
static uint8_t rx_buff[1] NO_CACHE;
|
||||
|
||||
static CJ125 globalInstance;
|
||||
|
||||
|
@ -83,15 +80,11 @@ static constexpr float lambdaLsu49[] = {
|
|||
};
|
||||
|
||||
|
||||
static int cjReadRegister(unsigned char regAddr) {
|
||||
static uint8_t cjReadRegister(uint8_t regAddr) {
|
||||
#if ! EFI_UNIT_TEST
|
||||
spiSelect(driver);
|
||||
tx_buff[0] = regAddr;
|
||||
spiSend(driver, 1, tx_buff);
|
||||
// safety?
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
rx_buff[0] = 0;
|
||||
spiReceive(driver, 1, rx_buff);
|
||||
spiUnselect(driver);
|
||||
|
||||
|
@ -104,7 +97,7 @@ static int cjReadRegister(unsigned char regAddr) {
|
|||
#endif /* EFI_UNIT_TEST */
|
||||
}
|
||||
|
||||
static void cjWriteRegister(unsigned char regAddr, unsigned char regValue) {
|
||||
static void cjWriteRegister(uint8_t regAddr, uint8_t regValue) {
|
||||
tx_buff[0] = regAddr;
|
||||
tx_buff[1] = regValue;
|
||||
#ifdef CJ125_DEBUG_SPI
|
||||
|
|
Loading…
Reference in New Issue