mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
modules/py_tv: Use micropy atomic instead of irq functions.
This commit is contained in:
parent
b64e3d625a
commit
bf9d3e555d
@ -15,6 +15,7 @@
|
||||
|
||||
#include "py/obj.h"
|
||||
#include "py/nlr.h"
|
||||
#include "py/mphal.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
#include "py_helper.h"
|
||||
@ -480,9 +481,9 @@ static void spi_tv_callback(omv_spi_t *spi, void *userdata, void *buf) {
|
||||
.flags = OMV_SPI_XFER_NONBLOCK,
|
||||
.callback = spi_tv_callback,
|
||||
};
|
||||
uint32_t irq_state = disable_irq();
|
||||
uint32_t irq_state = MICROPY_BEGIN_ATOMIC_SECTION();
|
||||
omv_spi_transfer_start(&spi_bus, &spi_xfer);
|
||||
enable_irq(irq_state);
|
||||
MICROPY_END_ATOMIC_SECTION(irq_state);
|
||||
break;
|
||||
}
|
||||
case SPI_TX_CB_MEMORY_WRITE: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user