Clan up the structure

This commit is contained in:
Attila Body 2025-05-31 17:45:15 +02:00
parent 340f0329fa
commit 45141798d8
Signed by: abody
GPG key ID: BD0C6214E68FB5CF
42 changed files with 134 additions and 452 deletions

View 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
View file

@ -0,0 +1,11 @@
#pragma once
#if defined(__cplusplus)
extern "C" {
#endif
void app_main();
#if defined(__cplusplus)
}
#endif

View 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_

View 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);
}
}

View 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();
}