--- Bus_SPI.cpp.orig 2024-11-22 16:12:20.561052300 +0900 +++ Bus_SPI.cpp 2025-04-04 16:13:20.533910740 +0900 @@ -60,14 +60,14 @@ return false; } - uint32_t temp = _spi_regs->cr0 & ~(SPI_SSPCR0_SCR_BITS | SPI_SSPCR0_DSS_BITS); - _clkdiv_write |= temp; - _clkdiv_read |= temp; - // DCピンを出力に設定 lgfxPinMode(_cfg.pin_dc, pin_mode_t::output); _spi_regs = reinterpret_cast(_spi_dev[_cfg.spi_host]); + uint32_t temp = _spi_regs->cr0 & ~(SPI_SSPCR0_SCR_BITS | SPI_SSPCR0_DSS_BITS); + _clkdiv_write |= temp; + _clkdiv_read |= temp; + int dma_ch = dma_claim_unused_channel(true); _dma_ch = dma_ch; if (dma_ch >= 0)