Make it work
This commit is contained in:
parent
8e9b69b87a
commit
4e1f01c4d4
25 changed files with 772 additions and 180 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 f4ll)
|
|
@ -14,7 +14,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
void MainLoop(void) __attribute__((noreturn));
|
||||
void app_main(void) __attribute__((noreturn));
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C" {
|
13
components/app/inc/irq_bridge.h
Normal file
13
components/app/inc/irq_bridge.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void usart2_rx_dma_isr(void);
|
||||
void usart2_tx_dma_isr(void);
|
||||
void usart2_isr(void);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
26
components/app/src/app.cpp
Normal file
26
components/app/src/app.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* ll_testbed.cpp
|
||||
*
|
||||
* Created on: Oct 28, 2019
|
||||
* Author: abody
|
||||
*/
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "stm32f4xx_ll_gpio.h"
|
||||
#include <main.h>
|
||||
|
||||
#include <f4ll/console_handler.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <app.h>
|
||||
|
||||
void app_main()
|
||||
{
|
||||
f4ll::console_handler &con = f4ll::console_handler::init(USART2, DMA1, LL_DMA_STREAM_5, LL_DMA_STREAM_6);
|
||||
while (true) {
|
||||
con.print("Hello woooooooooooooooooooooooooooooooorld!\n");
|
||||
HAL_Delay(500);
|
||||
LL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
* ll_testbed.cpp
|
||||
*
|
||||
* Created on: Oct 28, 2019
|
||||
* Author: abody
|
||||
*/
|
||||
#include "f4ll/console_handler.h"
|
||||
#include "f4ll/crc_handler.h"
|
||||
#include "f4ll/irq_lock.h"
|
||||
#include "f4ll/memcpy_dma.h"
|
||||
#include "f4ll/packet_usart.h"
|
||||
#include "f4ll/str_util.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <main.h>
|
||||
|
||||
void MainLoop()
|
||||
{
|
||||
while (true)
|
||||
;
|
||||
}
|
18
components/app/src/irq_bridge.cpp
Normal file
18
components/app/src/irq_bridge.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <f4ll/console_handler.h>
|
||||
|
||||
#include <irq_bridge.h>
|
||||
|
||||
void usart2_rx_dma_isr(void)
|
||||
{
|
||||
f4ll::console_handler::instance().rx_dma_isr();
|
||||
}
|
||||
|
||||
void usart2_tx_dma_isr(void)
|
||||
{
|
||||
f4ll::console_handler::instance().tx_dma_isr();
|
||||
}
|
||||
|
||||
void usart2_isr(void)
|
||||
{
|
||||
f4ll::console_handler::instance().usart_isr();
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef __PLATFORM_USART_LL_H_INCLUDED
|
||||
#define __PLATFORM_USART_LL_H_INCLUDED
|
||||
|
||||
#include "usart.h"
|
||||
#include <usart.h>
|
||||
|
||||
#endif // __PLATFORM_USART_LL_H_INCLUDED
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue