diff options
author | Paul Selkirk <paul@psgd.org> | 2016-07-06 18:23:56 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2016-07-06 18:23:56 -0400 |
commit | bc43cb1ce59ce5a628025a91d36868b0bf4791a4 (patch) | |
tree | ba3c4564eb92e841fad8b81b9af2664aabf0309b | |
parent | adb5eef77e646b7d063bdacccf883bb9ce6b2ade (diff) |
Amend 833802c: Add reentrancy protection to fmc_write_32.
-rw-r--r-- | stm-fmc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -77,12 +77,16 @@ int fmc_write_32(uint32_t addr, uint32_t *data) // calculate target fpga address uint32_t ptr = FMC_FPGA_BASE_ADDR + (addr & FMC_FPGA_ADDR_MASK); + __disable_irq(); + int status = // write data to fpga (HAL_SRAM_Write_32b(&_fmc_fpga_inst, (uint32_t *)ptr, data, 1) != HAL_OK) || // wait for transaction to complete _fmc_nwait_idle(); + __enable_irq(); + return status; } |