Clan up the structure
This commit is contained in:
parent
340f0329fa
commit
45141798d8
42 changed files with 134 additions and 452 deletions
10
components/app/CMakeLists.txt
Normal file
10
components/app/CMakeLists.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
add_library(app STATIC
|
||||
src/app.cpp
|
||||
src/irq_bridge.cpp
|
||||
)
|
||||
|
||||
target_include_directories(app PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/inc
|
||||
)
|
||||
|
||||
target_link_libraries(app PUBLIC stm32cubemx platform f1ll)
|
11
components/app/inc/app.h
Normal file
11
components/app/inc/app.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void app_main();
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
16
components/app/inc/irq_bridge.h
Normal file
16
components/app/inc/irq_bridge.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef IRQ_BRIDGE_H_
|
||||
#define IRQ_BRIDGE_H_
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void usart1_tx_dma_isr();
|
||||
void usart1_rx_dma_isr();
|
||||
void usart1_isr();
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // IRQ_BRIDGE_H_
|
16
components/app/src/app.cpp
Normal file
16
components/app/src/app.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include <app.h>
|
||||
|
||||
#include <main.h>
|
||||
|
||||
#include <f1ll/console_handler.h>
|
||||
|
||||
void app_main()
|
||||
{
|
||||
f1ll::console_handler::init(USART1, DMA1, LL_DMA_CHANNEL_5, LL_DMA_CHANNEL_4);
|
||||
|
||||
while (true) {
|
||||
f1ll::console_handler::instance().print("->> Hello <<-\r\n");
|
||||
LL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
|
||||
LL_mDelay(500);
|
||||
}
|
||||
}
|
18
components/app/src/irq_bridge.cpp
Normal file
18
components/app/src/irq_bridge.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <irq_bridge.h>
|
||||
|
||||
#include <f1ll/console_handler.h>
|
||||
|
||||
void usart1_tx_dma_isr() // DMA1 channel 4
|
||||
{
|
||||
f1ll::console_handler::instance().tx_dma_isr();
|
||||
}
|
||||
|
||||
void usart1_rx_dma_isr() // DMA1 channel 5
|
||||
{
|
||||
f1ll::console_handler::instance().rx_dma_isr();
|
||||
}
|
||||
|
||||
void usart1_isr()
|
||||
{
|
||||
f1ll::console_handler::instance().usart_isr();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue