Added delay also for raspberry and changed micro/mili seconds fault now time to implment a gpio for raspberry
parent
93dae2698b
commit
acdec3c387
@ -1,4 +1,4 @@
|
||||
####################################################################################################
|
||||
#SUBDIRECTORIES
|
||||
####################################################################################################
|
||||
#add_subdirectory(Src)
|
||||
add_subdirectory(Src)
|
||||
|
@ -1,6 +1,13 @@
|
||||
add_library(rpiGpio gpio.cpp)
|
||||
#add_library(rpiGpio gpio.cpp)
|
||||
|
||||
target_compile_options(rpiGpio PRIVATE ${C_FLAGS})
|
||||
target_compile_definitions(rpiGpio PRIVATE ${C_DEFS})
|
||||
target_include_directories(rpiGpio PRIVATE ${INTERFACES_DIR} ../Inc)
|
||||
add_library(sub::gpio ALIAS rpiGpio)
|
||||
#target_compile_options(rpiGpio PRIVATE ${C_FLAGS})
|
||||
#target_compile_definitions(rpiGpio PRIVATE ${C_DEFS})
|
||||
#target_include_directories(rpiGpio PRIVATE ${INTERFACES_DIR} ../Inc)
|
||||
#add_library(sub::gpio ALIAS rpiGpio)
|
||||
|
||||
add_library(rpiDelay delay.cpp)
|
||||
|
||||
target_compile_options(rpiDelay PRIVATE ${C_FLAGS})
|
||||
target_compile_definitions(rpiDelay PRIVATE ${C_DEFS})
|
||||
target_include_directories(rpiDelay PRIVATE ${INTERFACES_DIR} ../Inc)
|
||||
add_library(sub::delay ALIAS rpiDelay)
|
||||
|
@ -0,0 +1,17 @@
|
||||
#include "delay.hpp"
|
||||
#include <unistd.h>
|
||||
|
||||
Delay::Delay()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Delay::~Delay()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Delay::ms(uint16_t delay)
|
||||
{
|
||||
usleep(1000*delay);
|
||||
}
|
@ -1,8 +1,17 @@
|
||||
#include "bsl_raspberry.hpp"
|
||||
#include "../csl/interfaces/delay.hpp"
|
||||
|
||||
int startBSL()
|
||||
{
|
||||
std::cout << "Hello from raspberry" << std::endl;
|
||||
int i = 0;
|
||||
|
||||
Delay delay;
|
||||
|
||||
for(i=0; i < 5; i++)
|
||||
{
|
||||
std::cout << "Hello from raspberry" << std::endl;
|
||||
delay.ms(500);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in new issue