Integrate f1ll (compiles, untested)

This commit is contained in:
Attila Body 2025-05-27 23:04:02 +02:00
parent 0159a9cb45
commit 2b17bb1dae
Signed by: abody
GPG key ID: BD0C6214E68FB5CF
32 changed files with 924 additions and 128 deletions

10
app/CMakeLists.txt Normal file
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
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

15
app/inc/irq_bridge.h Normal file
View file

@ -0,0 +1,15 @@
#ifndef IRQ_BRIDGE_H_
#define IRQ_BRIDGE_H_
#if defined(__cplusplus)
extern "C" {
#endif
void dma1_channel4_irq_handler();
void dma1_channel5_irq_handler();
#if defined(__cplusplus)
}
#endif
#endif // IRQ_BRIDGE_H_

15
app/src/app.cpp Normal file
View file

@ -0,0 +1,15 @@
#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);
}
}

11
app/src/irq_bridge.cpp Normal file
View file

@ -0,0 +1,11 @@
#include <irq_bridge.h>
#include <f1ll/console_handler.h>
void dma1_channel4_irq_handler() {
f1ll::console_handler::instance().tx_dma_isr();
}
void dma1_channel5_irq_handler() {
f1ll::console_handler::instance().rx_dma_isr();
}