Working with ./run nucleo_f042K6 and ./run raspberry but must cahnge the headers. I will make a cmake configuration that will configure the main.hpp automatically
parent
69d64d5127
commit
3f78936c4e
@ -1,2 +1 @@
|
||||
project(Csl_Stm)
|
||||
add_subdirectory(stm32f042)
|
||||
add_subdirectory(${CLS_USED})
|
||||
|
@ -1,8 +1,4 @@
|
||||
project(Csl_Stm32f0xx ASM C CXX) # do this intead sf declaring languages in the beginning it will prevent loop errors.
|
||||
|
||||
####################################################################################################
|
||||
#SUBDIRECTORIES
|
||||
####################################################################################################
|
||||
add_subdirectory(Drivers)
|
||||
add_subdirectory(startup)
|
||||
add_subdirectory(Src)
|
||||
#add_subdirectory(Src)
|
||||
|
@ -1,8 +1,20 @@
|
||||
#include "bsl_nucleo_f042k6.h"
|
||||
#include "bsl_nucleo_f042k6.hpp"
|
||||
#include "../csl/interfaces/pin.hpp"
|
||||
|
||||
int cppHook()
|
||||
int startBSL()
|
||||
{
|
||||
stmStart();
|
||||
stmStart();
|
||||
|
||||
Pin pin;
|
||||
|
||||
while(1)
|
||||
{
|
||||
LL_mDelay(50);
|
||||
pin.write(true);
|
||||
LL_mDelay(50);
|
||||
pin.write(false);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
add_library(rpiTranslator bsl_raspberry.cpp)
|
||||
|
||||
target_compile_options(rpiTranslator PRIVATE ${C_FLAGS})
|
||||
target_compile_definitions(rpiTranslator PRIVATE ${C_DEFS})
|
||||
target_include_directories(rpiTranslator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
add_library(sub::translator ALIAS rpiTranslator)
|
@ -0,0 +1,14 @@
|
||||
####################################################################################################
|
||||
# bsl_nucleo_f042k6_compiler.cmake
|
||||
####################################################################################################
|
||||
|
||||
set(CMAKE_SIZE "/usr/bin/size")
|
||||
set(CMAKE_C_COMPILER "/usr/bin/gcc")
|
||||
set(CMAKE_CXX_COMPILER "/usr/bin/g++")
|
||||
|
||||
option(IS_NO_SYS "Use a custom linker script" OFF)
|
||||
option(NEED_OBJCOPY "If objcopy is neede for cross compilation" OFF)
|
||||
|
||||
####################################################################################################
|
||||
#PROJECT & LIBRARIES : defined by user and important that it comes after the VARIABLES otherwise the Set varibale will not be used.
|
||||
####################################################################################################
|
@ -0,0 +1,26 @@
|
||||
####################################################################################################
|
||||
# bsl_nucleo_f042k6.cmake
|
||||
####################################################################################################
|
||||
|
||||
####################################################################################################
|
||||
#PROJECT & LIBRARIES : defined by user and important that it comes after the VARIABLES otherwise the Set varibale will not be used.
|
||||
####################################################################################################
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(BSL_INC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(CLS_USED ${CMAKE_SOURCE_DIR}/bsl/csl/rpi)
|
||||
####################################################################################################
|
||||
#VARIABLES : defined by user
|
||||
####################################################################################################
|
||||
|
||||
set(C_FLAGS
|
||||
-Wall #Error : If you don't know this one please chek basical compiling
|
||||
-fdiagnostics-color=always
|
||||
$<$<CONFIG:Debug>:-O -g -gdwarf-2>)
|
||||
|
||||
set(C_DEFS -DSET_ALARM)
|
||||
|
||||
set (CPP_INCLUDES ${CMAKE_SOURCE_DIR})
|
||||
set (CPP_FLAGS ${C_FLAGS})
|
||||
set (CPP_DEFS ${C_DEFS})
|
||||
|
||||
list(APPEND EXTRA_LIBS sub::translator)
|
@ -0,0 +1,8 @@
|
||||
#include "bsl_raspberry.hpp"
|
||||
|
||||
int startBSL()
|
||||
{
|
||||
std::cout << "Hello from raspberry" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
#ifndef BSL_RASPBERRY_HPP
|
||||
#define BSL_RASPBERRY_HPP
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
|
||||
int startBSL();
|
||||
#endif
|
@ -1,18 +1,10 @@
|
||||
#include"main.hpp"
|
||||
#include "bsl/csl/interfaces/pin.hpp"
|
||||
|
||||
#include "bsl/raspberry/bsl_raspberry.hpp"
|
||||
//#include "bsl/nucleo_f042k6/bsl_nucleo_f042k6.hpp"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Pin pin;
|
||||
|
||||
cppHook();
|
||||
|
||||
while(1)
|
||||
{
|
||||
LL_mDelay(500);
|
||||
pin.write(true);
|
||||
LL_mDelay(500);
|
||||
pin.write(false);
|
||||
}
|
||||
startBSL();
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in new issue