Interrupt handlers C -> C++

This commit is contained in:
Attila Body 2019-11-04 09:57:31 +01:00
parent 9dba241466
commit 4de62c7f74
10 changed files with 105 additions and 75 deletions

View file

@ -105,9 +105,6 @@
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1329542300" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/> <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1329542300" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
</toolChain> </toolChain>
</folderInfo> </folderInfo>
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1652594594.1362154686" name="application.c" rcbsApplicability="disable" resourcePath="app/application.c" toolsToInvoke="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.954718294.1426855840">
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.954718294.1426855840" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.954718294"/>
</fileInfo>
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1652594594.1247500854" name="/" resourcePath="lib"> <folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1652594594.1247500854" name="/" resourcePath="lib">
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.1812794617" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug" unusedChildren=""> <toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.1812794617" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug" unusedChildren="">
<option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.1720703955.1442910858" name="Internal Toolchain Type" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.1720703955"/> <option id="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.1720703955.1442910858" name="Internal Toolchain Type" superClass="com.st.stm32cube.ide.mcu.option.internal.toolchain.type.1720703955"/>
@ -185,7 +182,7 @@
</tool> </tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1361867544" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler"> <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1361867544" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.772898973" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.772898973" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1930748476" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o3" valueType="enumerated"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1930748476" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.ofast" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.151564892" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.151564892" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/> <listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
<listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/> <listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>
@ -208,7 +205,7 @@
</tool> </tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1987753758" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler"> <tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.1987753758" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.492230322" 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.g0" valueType="enumerated"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.492230322" 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.g0" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.2001061530" 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.o3" valueType="enumerated"/> <option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.2001061530" 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.ofast" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.158099046" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath"> <option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.158099046" 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="../Inc"/> <listOptionValue builtIn="false" value="../Inc"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/> <listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
@ -291,7 +288,7 @@
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Startup"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Startup"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="app"/> <entry excluding="application.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="app"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lib"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lib"/>
</sourceEntries> </sourceEntries>
</configuration> </configuration>

View file

@ -16,6 +16,9 @@
* *
****************************************************************************** ******************************************************************************
*/ */
#ifdef __cplusplus
extern "C" {
/* USER CODE END Header */ /* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/
@ -29,7 +32,11 @@
#include "memcpy_dma.h" #include "memcpy_dma.h"
#include "globals.h" #include "globals.h"
#include "diag.h" #include "diag.h"
#include "ll_testbed.h" }
#include "globals_cpp.h"
extern "C" {
/* USER CODE END Includes */ /* USER CODE END Includes */
@ -215,7 +222,7 @@ void SysTick_Handler(void)
void DMA1_Stream1_IRQHandler(void) void DMA1_Stream1_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA1_Stream1_IRQn 0 */ /* USER CODE BEGIN DMA1_Stream1_IRQn 0 */
_HandleUsartRxDmaIrq(USART3_OFFSET); f4ll::LL_HsUsart::HandleRxDmaIrq(g_usarts[USART3_OFFSET]);
/* USER CODE END DMA1_Stream1_IRQn 0 */ /* USER CODE END DMA1_Stream1_IRQn 0 */
/* USER CODE BEGIN DMA1_Stream1_IRQn 1 */ /* USER CODE BEGIN DMA1_Stream1_IRQn 1 */
@ -243,7 +250,7 @@ void DMA1_Stream2_IRQHandler(void)
void DMA1_Stream3_IRQHandler(void) void DMA1_Stream3_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA1_Stream3_IRQn 0 */ /* USER CODE BEGIN DMA1_Stream3_IRQn 0 */
_HandleUsartTxDmaIrq(USART3_OFFSET); f4ll::LL_HsUsart::HandleTxDmaIrq(g_usarts[USART3_OFFSET]);
/* USER CODE END DMA1_Stream3_IRQn 0 */ /* USER CODE END DMA1_Stream3_IRQn 0 */
/* USER CODE BEGIN DMA1_Stream3_IRQn 1 */ /* USER CODE BEGIN DMA1_Stream3_IRQn 1 */
@ -271,7 +278,7 @@ void DMA1_Stream4_IRQHandler(void)
void DMA1_Stream5_IRQHandler(void) void DMA1_Stream5_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA1_Stream5_IRQn 0 */ /* USER CODE BEGIN DMA1_Stream5_IRQn 0 */
_HandleUsartRxDmaIrq(USART2_OFFSET); f4ll::LL_HsUsart::HandleRxDmaIrq(g_usarts[USART2_OFFSET]);
/* USER CODE END DMA1_Stream5_IRQn 0 */ /* USER CODE END DMA1_Stream5_IRQn 0 */
/* USER CODE BEGIN DMA1_Stream5_IRQn 1 */ /* USER CODE BEGIN DMA1_Stream5_IRQn 1 */
@ -285,7 +292,7 @@ void DMA1_Stream5_IRQHandler(void)
void DMA1_Stream6_IRQHandler(void) void DMA1_Stream6_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA1_Stream6_IRQn 0 */ /* USER CODE BEGIN DMA1_Stream6_IRQn 0 */
_HandleUsartTxDmaIrq(USART2_OFFSET); f4ll::LL_HsUsart::HandleTxDmaIrq(g_usarts[USART2_OFFSET]);
/* USER CODE END DMA1_Stream6_IRQn 0 */ /* USER CODE END DMA1_Stream6_IRQn 0 */
/* USER CODE BEGIN DMA1_Stream6_IRQn 1 */ /* USER CODE BEGIN DMA1_Stream6_IRQn 1 */
@ -325,7 +332,8 @@ void SPI2_IRQHandler(void)
void USART1_IRQHandler(void) void USART1_IRQHandler(void)
{ {
/* USER CODE BEGIN USART1_IRQn 0 */ /* USER CODE BEGIN USART1_IRQn 0 */
_HandleUsartIrq(USART1_OFFSET); f4ll::LL_HsUsart::HandleUsartIrq(g_usarts[USART1_OFFSET]);
// _HandleUsartIrq();
/* USER CODE END USART1_IRQn 0 */ /* USER CODE END USART1_IRQn 0 */
/* USER CODE BEGIN USART1_IRQn 1 */ /* USER CODE BEGIN USART1_IRQn 1 */
@ -338,7 +346,7 @@ void USART1_IRQHandler(void)
void USART2_IRQHandler(void) void USART2_IRQHandler(void)
{ {
/* USER CODE BEGIN USART2_IRQn 0 */ /* USER CODE BEGIN USART2_IRQn 0 */
_HandleUsartIrq(USART2_OFFSET); f4ll::LL_HsUsart::HandleUsartIrq(g_usarts[USART2_OFFSET]);
/* USER CODE END USART2_IRQn 0 */ /* USER CODE END USART2_IRQn 0 */
/* USER CODE BEGIN USART2_IRQn 1 */ /* USER CODE BEGIN USART2_IRQn 1 */
@ -351,7 +359,7 @@ void USART2_IRQHandler(void)
void USART3_IRQHandler(void) void USART3_IRQHandler(void)
{ {
/* USER CODE BEGIN USART3_IRQn 0 */ /* USER CODE BEGIN USART3_IRQn 0 */
_HandleUsartIrq(USART3_OFFSET); f4ll::LL_HsUsart::HandleUsartIrq(g_usarts[USART3_OFFSET]);
/* USER CODE END USART3_IRQn 0 */ /* USER CODE END USART3_IRQn 0 */
/* USER CODE BEGIN USART3_IRQn 1 */ /* USER CODE BEGIN USART3_IRQn 1 */
@ -391,7 +399,7 @@ void DMA2_Stream0_IRQHandler(void)
void DMA2_Stream1_IRQHandler(void) void DMA2_Stream1_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA2_Stream1_IRQn 0 */ /* USER CODE BEGIN DMA2_Stream1_IRQn 0 */
_HandleUsartRxDmaIrq(USART6_OFFSET); f4ll::LL_HsUsart::HandleRxDmaIrq(g_usarts[USART6_OFFSET]);
/* USER CODE END DMA2_Stream1_IRQn 0 */ /* USER CODE END DMA2_Stream1_IRQn 0 */
/* USER CODE BEGIN DMA2_Stream1_IRQn 1 */ /* USER CODE BEGIN DMA2_Stream1_IRQn 1 */
@ -405,7 +413,7 @@ void DMA2_Stream1_IRQHandler(void)
void DMA2_Stream2_IRQHandler(void) void DMA2_Stream2_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA2_Stream2_IRQn 0 */ /* USER CODE BEGIN DMA2_Stream2_IRQn 0 */
_HandleUsartRxDmaIrq(USART1_OFFSET); f4ll::LL_HsUsart::HandleRxDmaIrq(g_usarts[USART1_OFFSET]);
/* USER CODE END DMA2_Stream2_IRQn 0 */ /* USER CODE END DMA2_Stream2_IRQn 0 */
/* USER CODE BEGIN DMA2_Stream2_IRQn 1 */ /* USER CODE BEGIN DMA2_Stream2_IRQn 1 */
@ -434,11 +442,11 @@ void DMA2_Stream3_IRQHandler(void)
void DMA2_Stream4_IRQHandler(void) void DMA2_Stream4_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA2_Stream4_IRQn 0 */ /* USER CODE BEGIN DMA2_Stream4_IRQn 0 */
//HandleCrcDmaIrq(&g_crcStatus); f4ll::LL_CrcHandler::Instance().DmaTransferCompleted();
/* USER CODE END DMA2_Stream4_IRQn 0 */ /* USER CODE END DMA2_Stream4_IRQn 0 */
/* USER CODE BEGIN DMA2_Stream4_IRQn 1 */ /* USER CODE BEGIN DMA2_Stream4_IRQn 1 */
_HandleCrcDmaIrq();
/* USER CODE END DMA2_Stream4_IRQn 1 */ /* USER CODE END DMA2_Stream4_IRQn 1 */
} }
@ -462,7 +470,7 @@ void DMA2_Stream5_IRQHandler(void)
void DMA2_Stream6_IRQHandler(void) void DMA2_Stream6_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA2_Stream6_IRQn 0 */ /* USER CODE BEGIN DMA2_Stream6_IRQn 0 */
_HandleUsartTxDmaIrq(USART6_OFFSET); f4ll::LL_HsUsart::HandleTxDmaIrq(g_usarts[USART6_OFFSET]);
/* USER CODE END DMA2_Stream6_IRQn 0 */ /* USER CODE END DMA2_Stream6_IRQn 0 */
/* USER CODE BEGIN DMA2_Stream6_IRQn 1 */ /* USER CODE BEGIN DMA2_Stream6_IRQn 1 */
@ -476,7 +484,7 @@ void DMA2_Stream6_IRQHandler(void)
void DMA2_Stream7_IRQHandler(void) void DMA2_Stream7_IRQHandler(void)
{ {
/* USER CODE BEGIN DMA2_Stream7_IRQn 0 */ /* USER CODE BEGIN DMA2_Stream7_IRQn 0 */
_HandleUsartTxDmaIrq(USART1_OFFSET); f4ll::LL_HsUsart::HandleTxDmaIrq(g_usarts[USART1_OFFSET]);
/* USER CODE END DMA2_Stream7_IRQn 0 */ /* USER CODE END DMA2_Stream7_IRQn 0 */
/* USER CODE BEGIN DMA2_Stream7_IRQn 1 */ /* USER CODE BEGIN DMA2_Stream7_IRQn 1 */
@ -490,7 +498,7 @@ void DMA2_Stream7_IRQHandler(void)
void USART6_IRQHandler(void) void USART6_IRQHandler(void)
{ {
/* USER CODE BEGIN USART6_IRQn 0 */ /* USER CODE BEGIN USART6_IRQn 0 */
_HandleUsartIrq(USART6_OFFSET); f4ll::LL_HsUsart::HandleUsartIrq(g_usarts[USART6_OFFSET]);
/* USER CODE END USART6_IRQn 0 */ /* USER CODE END USART6_IRQn 0 */
/* USER CODE BEGIN USART6_IRQn 1 */ /* USER CODE BEGIN USART6_IRQn 1 */
@ -499,5 +507,7 @@ void USART6_IRQHandler(void)
/* USER CODE BEGIN 1 */ /* USER CODE BEGIN 1 */
}
#endif // __cplusplus
/* USER CODE END 1 */ /* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

1
Src/stm32f4xx_it_.cpp Symbolic link
View file

@ -0,0 +1 @@
stm32f4xx_it.c

13
app/globals_cpp.cpp Normal file
View file

@ -0,0 +1,13 @@
/*
* globals_cpp.cpp
*
* Created on: Nov 4, 2019
* Author: abody
*/
#include "globals.h"
#include "ll_hsusart.h"
f4ll::LL_HsUsart *g_usarts[4];

17
app/globals_cpp.h Normal file
View file

@ -0,0 +1,17 @@
/*
* globals_cpp.h
*
* Created on: Nov 4, 2019
* Author: abody
*/
#ifndef GLOBALS_CPP_H_
#define GLOBALS_CPP_H_
#ifdef __cplusplus
#include "ll_hsusart.h"
extern f4ll::LL_HsUsart *g_usarts[4];
#endif // __cplusplus
#endif /* GLOBALS_CPP_H_ */

View file

@ -8,39 +8,16 @@
#include <stdlib.h> #include <stdlib.h>
#include "ll_hsusart.h" #include "ll_hsusart.h"
#include "ll_crchandler.h" #include "ll_crchandler.h"
#include "ll_testbed.h"
#include "main.h"
extern "C" { extern "C" {
#include "main.h"
#include "globals.h" #include "globals.h"
#include "strutil.h" #include "strutil.h"
} }
#include "globals_cpp.h"
#define PACKAGE_DELAY_MS 0 #define PACKAGE_DELAY_MS 0
#define STATS_DELAY_MS 1000 #define STATS_DELAY_MS 1000
f4ll::LL_CrcHandler *g_crc = nullptr;
f4ll::LL_HsUsart *g_usarts[4];
extern "C" void _HandleCrcDmaIrq(void)
{
f4ll::LL_CrcHandler::Instance().DmaTransferCompleted();
}
extern "C" void _HandleUsartIrq(int offset)
{
f4ll::LL_HsUsart::HandleUsartIrq(g_usarts[offset]);
}
extern "C" void _HandleUsartRxDmaIrq(int offset)
{
f4ll::LL_HsUsart::HandleRxDmaIrq(g_usarts[offset]);
}
extern "C" void _HandleUsartTxDmaIrq(int offset)
{
f4ll::LL_HsUsart::HandleTxDmaIrq(g_usarts[offset]);
}
#define ADDINFO(b,s,u) \ #define ADDINFO(b,s,u) \
b += strcpy_ex(b,s); \ b += strcpy_ex(b,s); \
@ -85,7 +62,7 @@ extern "C" void MainLoop()
f4ll::LL_CrcHandler::Init(DMA2, LL_DMA_STREAM_4); f4ll::LL_CrcHandler::Init(DMA2, LL_DMA_STREAM_4);
f4ll::LL_CrcHandler::Slot<2> slt; f4ll::LL_CrcHandler::Slot<2> slt;
f4ll::LL_HsUsart u1{USART1, DMA2, LL_DMA_STREAM_2, LL_DMA_STREAM_7}; f4ll::LL_HsUsart u1{ USART1, DMA2, LL_DMA_STREAM_2, LL_DMA_STREAM_7 };
f4ll::LL_HsUsart u2{ USART2, DMA1, LL_DMA_STREAM_5, LL_DMA_STREAM_6 }; f4ll::LL_HsUsart u2{ USART2, DMA1, LL_DMA_STREAM_5, LL_DMA_STREAM_6 };
f4ll::LL_HsUsart u3{ USART3, DMA1, LL_DMA_STREAM_1, LL_DMA_STREAM_3 }; f4ll::LL_HsUsart u3{ USART3, DMA1, LL_DMA_STREAM_1, LL_DMA_STREAM_3 };
f4ll::LL_HsUsart u6{ USART6, DMA2, LL_DMA_STREAM_1, LL_DMA_STREAM_6 }; f4ll::LL_HsUsart u6{ USART6, DMA2, LL_DMA_STREAM_1, LL_DMA_STREAM_6 };

View file

@ -1,27 +0,0 @@
/*
* ll_testbed.h
*
* Created on: Oct 31, 2019
* Author: compi
*/
#ifndef LL_TESTBED_H_
#define LL_TESTBED_H_
#ifdef __cplusplus
extern "C" {
#endif
void _HandleCrcDmaIrq(void);
void _HandleUsartIrq(int offset);
void _HandleUsartRxDmaIrq(int offset);
void _HandleUsartTxDmaIrq(int offset);
#ifdef __cplusplus
}
#endif
#endif /* LL_TESTBED_H_ */

View file

@ -68,12 +68,12 @@ public:
bool IsQueued(SlotBase &slot, uint8_t prio) const; bool IsQueued(SlotBase &slot, uint8_t prio) const;
bool IsRunning(SlotBase &slot, uint8_t prio) const; bool IsRunning(SlotBase &slot, uint8_t prio) const;
void DmaTransferCompleted(void);
private: private:
LL_CrcHandler(DMA_TypeDef *dma, uint32_t stream); LL_CrcHandler(DMA_TypeDef *dma, uint32_t stream);
friend void ::_HandleCrcDmaIrq(void); friend void ::_HandleCrcDmaIrq(void);
void DmaTransferCompleted(void);
void StartNextTask(void); void StartNextTask(void);
void WaitResults(SlotBase &slot, uint8_t prio) const; void WaitResults(SlotBase &slot, uint8_t prio) const;

18
lib/ll_memcpydma.cpp Normal file
View file

@ -0,0 +1,18 @@
/*
* llmemcpydma.cpp
*
* Created on: Nov 4, 2019
* Author: abody
*/
#include <ll_memcpydma.h>
namespace f4ll {
LL_MemcpyDma::LL_MemcpyDma(DMA_TypeDef *dma, uint32_t stream)
: LL_DmaHelper(dma, stream)
{
LL_DMA_EnableIT_TC(dma, stream);
}
} /* namespace f4ll */

24
lib/ll_memcpydma.h Normal file
View file

@ -0,0 +1,24 @@
/*
* llmemcpydma.h
*
* Created on: Nov 4, 2019
* Author: abody
*/
#ifndef LL_MEMCPY_DMA_H_
#define LL_MEMCPY_DMA_H_
#include "ll_dmahelper.h"
namespace f4ll {
class LL_MemcpyDma : private LL_DmaHelper
{
public:
LL_MemcpyDma(DMA_TypeDef *dma, uint32_t stream);
void Copy(void *dst, void const *src, uint16_t length);
};
} /* namespace f4ll */
#endif /* LL_MEMCPY_DMA_H_ */