Circular DMA buffer

This commit is contained in:
Attila Body 2020-12-01 21:54:43 +01:00
parent 731bba0f0e
commit 3f48d95efd
9 changed files with 72 additions and 79 deletions

View file

@ -52,7 +52,6 @@
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1451503988" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
@ -65,7 +64,6 @@
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.177173672" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="VDD_VALUE=3300"/>
@ -116,6 +114,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1739656132.2067213543" name="CpuCoreId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1739656132"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.162671610.656344690" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.162671610"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.416086734.1209833264" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.416086734"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.2079844426" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.130003299">
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1064216246" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool>
@ -198,7 +197,6 @@
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.935831936" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
@ -206,11 +204,11 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.395030761" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1387247021" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.1816221792" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../"/>
<listOptionValue builtIn="false" value="../Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1623578821" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="VDD_VALUE=3300"/>
@ -261,6 +259,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.803288303.1313211824" name="CpuCoreId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.803288303"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.142185949.76141751" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.142185949"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1897240971.221491963" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1897240971"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.557873719" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.2006730064">
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.2019763359" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool>
@ -333,7 +332,6 @@
<listOptionValue builtIn="false" value="../"/>
<listOptionValue builtIn="false" value="../Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
</option>
@ -348,10 +346,9 @@
<listOptionValue builtIn="false" value="DEBUG"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.1711834414" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value=".."/>
<listOptionValue builtIn="false" value="../"/>
<listOptionValue builtIn="false" value="../Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
</option>
@ -459,7 +456,6 @@
<listOptionValue builtIn="false" value="../"/>
<listOptionValue builtIn="false" value="../Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
</option>
@ -473,10 +469,9 @@
<listOptionValue builtIn="false" value="STM32F103xB"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.726216263" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value=".."/>
<listOptionValue builtIn="false" value="../"/>
<listOptionValue builtIn="false" value="../Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F1xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
</option>

View file

@ -21,21 +21,18 @@
Sparkle g_sparkles[NUMSPARKLES];
volatile uint8_t g_spi_idle = 0;
uint16_t g_pixels_transmitted;
volatile uint8_t g_buffer_in_transmit;
volatile bool g_need_refill;
uint32_t g_refills = 0;
uint16_t g_pixels_converted = 0;
volatile uint16_t g_pixels_converted = 0;
volatile uint32_t g_tick = 0;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
void convert(uint8_t *src, uint8_t *dst, uint16_t size)
void convert(uint8_t *src, uint8_t *dst, uint16_t src_size)
{
static uint8_t const bits[4] = { 0b10001000, 0b10001110, 0b11101000, 0b11101110 };
while(size--) {
while(src_size--) {
uint8_t byte=*src++;
for(int8_t shift = 6; shift >= 0; shift -= 2) {
uint8_t mask = 3 << shift;
@ -70,7 +67,11 @@ uint16_t ChoosePixel()
void StartSparkle( Sparkle &s )
{
#ifndef DBG_CHOSEN_PIXEL
s.Start(g_pixels+ChoosePixel(), rr(32), Pixel(255,255,255), Pixel(rr(8)+3,rr(8)+3,rr(8)+3));
#else
s.Start(g_pixels+ChoosePixel(), 0, Pixel(255,255,255), Pixel(1, 1, 1));
#endif
}
extern "C" void HandleSystick()
@ -83,56 +84,59 @@ extern "C" uint32_t GetTick()
return g_tick;
}
extern "C" void HandleSpiDmaIrq()
{
static bool endframe;
static bool endframe = false;
static bool endprev = false;
if(LL_DMA_IsActiveFlag_TC3(DMA1))
if(LL_DMA_IsActiveFlag_TE3(DMA1)) {
LL_DMA_ClearFlag_TE3(DMA1);
}
else if(LL_DMA_IsActiveFlag_HT3(DMA1) || LL_DMA_IsActiveFlag_TC3(DMA1))
{
if(LL_DMA_IsActiveFlag_HT3(DMA1))
{
LL_DMA_ClearFlag_HT3(DMA1);
g_buffer_in_transmit = 1;
if(endframe)
LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_3, LL_DMA_MODE_NORMAL);
}
else if(LL_DMA_IsActiveFlag_TC3(DMA1))
{
LL_DMA_ClearFlag_TC3(DMA1);
g_buffer_in_transmit = 0;
if(endframe && endprev) {
LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_3);
LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_3, LL_DMA_MODE_CIRCULAR);
g_spi_idle = true;
endframe = endprev = false;
return;
}
}
g_buffer_in_transmit ^= 1;
g_pixels_transmitted += SPIBUFFER_PIXELS;
endprev = endframe;
if(g_pixels_transmitted < NUMPIXELS)
{
LL_DMA_SetMemoryAddress(DMA1, LL_DMA_CHANNEL_3, (uint32_t)g_spibuffer[g_buffer_in_transmit]);
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_3, SPIBUFFER_SIZE);
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_3);
uint8_t convert_now = MIN(NUMPIXELS - g_pixels_converted, SPIBUFFER_PIXELS);
if(g_pixels_converted < NUMPIXELS)
if(convert_now)
{
LL_GPIO_TogglePin(GPIOC, LL_GPIO_PIN_13);
convert((uint8_t*)&g_pixels[g_pixels_converted],
g_spibuffer[g_buffer_in_transmit ^ 1],
MIN(SPIBUFFER_PIXELS, NUMPIXELS - g_pixels_converted) * sizeof(pixel_t));
g_pixels_converted += MIN(SPIBUFFER_PIXELS, NUMPIXELS - g_pixels_converted);
convert_now * sizeof(pixel_t));
LL_GPIO_TogglePin(GPIOC, LL_GPIO_PIN_13);
endframe = false;
g_pixels_converted += convert_now;
}
else
{
memset(g_spibuffer[g_buffer_in_transmit ^1], 0, sizeof(g_spibuffer[g_buffer_in_transmit ^1]));
if(convert_now < SPIBUFFER_PIXELS) {
memset(g_spibuffer[g_buffer_in_transmit ^ 1] + convert_now * SPIBUFFER_PIXEL_SIZE,
0, SPIBUFFER_SIZE - convert_now * SPIBUFFER_PIXEL_SIZE);
endframe = true;
}
}
}
}
else if(endframe)
{
LL_DMA_SetMemoryAddress(DMA1, LL_DMA_CHANNEL_3, (uint32_t)g_spibuffer[g_buffer_in_transmit]);
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_3, SPIBUFFER_SIZE);
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_3);
endframe = false;
}
else {
g_spi_idle = true;
}
}
else if(LL_DMA_IsActiveFlag_TE3(DMA1))
LL_DMA_ClearFlag_TE3(DMA1);
}
extern "C" void App()
{
@ -158,8 +162,6 @@ extern "C" void App()
}
g_pixels_converted = 0;
g_pixels_transmitted = 0;
g_need_refill = true;
convert((uint8_t*)g_pixels, g_spibuffer[0], SPIBUFFER_PIXELS * sizeof(pixel_t));
g_pixels_converted += SPIBUFFER_PIXELS;
@ -167,13 +169,14 @@ extern "C" void App()
g_pixels_converted += SPIBUFFER_PIXELS;
g_buffer_in_transmit = 0;
g_spi_idle = false;
LL_DMA_ConfigAddresses(DMA1, LL_DMA_CHANNEL_3, (uint32_t)g_spibuffer[0], LL_SPI_DMA_GetRegAddr(SPI1), LL_DMA_DIRECTION_MEMORY_TO_PERIPH);
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_3, SPIBUFFER_SIZE);
LL_DMA_ConfigAddresses(DMA1, LL_DMA_CHANNEL_3, (uint32_t)g_spibuffer, LL_SPI_DMA_GetRegAddr(SPI1), LL_DMA_DIRECTION_MEMORY_TO_PERIPH);
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_3, sizeof(g_spibuffer));
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_3);
LL_DMA_EnableIT_HT(DMA1, LL_DMA_CHANNEL_3);
LL_DMA_EnableIT_TC(DMA1, LL_DMA_CHANNEL_3);
LL_DMA_EnableIT_TE(DMA1, LL_DMA_CHANNEL_3);
g_spi_idle = false;
while(!g_spi_idle);

View file

@ -15,11 +15,11 @@
# define NUMSPARKLES (NUMPIXELS/12+1)
# define FRAMETIME 20
#else
# define NUMPIXELS 6
# define NUMPIXELS 144
# define NUMSPARKLES 1
# define FRAMETIME 1
# define FRAMETIME 10
#endif
#define DEFAULT_COLOR 63,63,63
#define SPIBUFFER_PIXELS 2
#define DEFAULT_COLOR 15,15,15
#define SPIBUFFER_PIXELS 4
#endif /* CONFIG_H_ */

View file

@ -6,13 +6,6 @@
*/
#include "LedBuffers.h"
pixel_t g_pixels[NUMPIXELS] = {
{0xaa,0x55,0},
{0x55,0xaa,0xff},
{0xaa,0x55,0},
{0x55,0xaa,0xff},
{0xaa,0x55,0},
{0x55,0xaa,0xff},
};
pixel_t g_pixels[NUMPIXELS];
uint8_t g_spibuffer[2][SPIBUFFER_SIZE];

View file

@ -13,7 +13,8 @@
extern pixel_t g_pixels[NUMPIXELS];
#define SPIBUFFER_SIZE (SPIBUFFER_PIXELS * sizeof(pixel_t) * 8 / 2)
#define SPIBUFFER_PIXEL_SIZE ( sizeof(pixel_t) * 4) // each raw pixel bit represented by 4 bits in SPI transfer
#define SPIBUFFER_SIZE (SPIBUFFER_PIXELS * SPIBUFFER_PIXEL_SIZE)
extern uint8_t g_spibuffer[2][SPIBUFFER_SIZE];

View file

@ -49,7 +49,7 @@
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="App"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="true"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
@ -57,7 +57,7 @@
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="App"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/NeoPixelF103MVP.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="NeoPixelF103MVP"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
@ -68,5 +68,6 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

View file

@ -49,7 +49,7 @@
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="true"/>
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="App"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="arm-none-eabi-gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="true"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
@ -57,7 +57,7 @@
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="App"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Release/NeoPixelF103MVP.elf"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="NeoPixelF103MVP"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>

View file

@ -5,7 +5,7 @@ Dma.SPI1_TX.0.Direction=DMA_MEMORY_TO_PERIPH
Dma.SPI1_TX.0.Instance=DMA1_Channel3
Dma.SPI1_TX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE
Dma.SPI1_TX.0.MemInc=DMA_MINC_ENABLE
Dma.SPI1_TX.0.Mode=DMA_NORMAL
Dma.SPI1_TX.0.Mode=DMA_CIRCULAR
Dma.SPI1_TX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
Dma.SPI1_TX.0.PeriphInc=DMA_PINC_DISABLE
Dma.SPI1_TX.0.Priority=DMA_PRIORITY_HIGH

View file

@ -52,7 +52,7 @@ void MX_SPI1_Init(void)
LL_DMA_SetChannelPriorityLevel(DMA1, LL_DMA_CHANNEL_3, LL_DMA_PRIORITY_HIGH);
LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_3, LL_DMA_MODE_NORMAL);
LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_3, LL_DMA_MODE_CIRCULAR);
LL_DMA_SetPeriphIncMode(DMA1, LL_DMA_CHANNEL_3, LL_DMA_PERIPH_NOINCREMENT);