I will soon womit CMAKE but its taking ever more shape, if we finr an implmentation without header it wil generate an fatal error, now i will implement a check to find out if two source file or two header files have the same name
parent
36be0a0f9e
commit
9fb6a9fcb3
@ -0,0 +1,15 @@
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MAIN_H */
|
@ -0,0 +1,40 @@
|
||||
#include "main.h"
|
||||
#include "delay.h"
|
||||
#include "pin.h"
|
||||
#include "deviceSetup.h"
|
||||
#include "uartComm.h"
|
||||
#include "sensor.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
uint8_t i = 0;
|
||||
|
||||
delayInitMs(8000000, 1000); // Clock Freq and Divider for ARM library
|
||||
|
||||
pinConfig(pinB3, output, pushPull, def_res, def_speed);
|
||||
pinConfig(pinA0, input, def_stage, pullDown, def_speed);
|
||||
|
||||
setupInit(); // This is the sescond call of System init the assebly start code is calling it before the main.
|
||||
|
||||
uartCommInit();
|
||||
//blinks 10 times to indicate the sicsessfull init if the device
|
||||
for(i = 0 ; i < 2 ; i++) {
|
||||
delayMs(100);
|
||||
pinToggle(pinB3);
|
||||
delayMs(100);
|
||||
}
|
||||
|
||||
uartCommPrintWellcome();
|
||||
sensorActivate(1);
|
||||
sensorActivate(0);
|
||||
|
||||
while(1)
|
||||
{
|
||||
delayMs(100);
|
||||
pinToggle(pinB3);
|
||||
delayMs(100);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
#Declareing header directory for the project
|
||||
#To add a new directory
|
||||
# -> list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY)
|
||||
# list() = List declaration "DON'T CHANGE"
|
||||
# PROJECT_HEADERS_DIR = Variable containing the listed direcotries "DON'T CHANCE
|
||||
# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt
|
||||
list(APPEND PROJECT_HEADERS_DIR ${PROJECT_DIR}/headers)
|
||||
|
||||
#Declaring sources directory for the project
|
||||
#To add a new directory
|
||||
# -> list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/YOUR_DESIRED_DIRECTORY)
|
||||
# list() = List declaration "DON'T CHANGE"
|
||||
# PROJECT_SOURCES_DIR = Variable containing the listed direcotries "DON'T CHANCE
|
||||
# ${PROJECT_DIR} = Direcotry of the main project this is per default the current direcotry it is defined in ked/CMakeLists.txt
|
||||
list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/src)
|
||||
list(APPEND PROJECT_SOURCES_DIR ${PROJECT_DIR}/sensors)
|
||||
|
||||
#Declaring sources to be compiled for the project.
|
||||
#CMake will look in each previsouly declarec sources directory until to find this files.
|
||||
set(PROJECT_SOURCES_DIR_LIST uartComm sensor)
|
||||
|
Loading…
Reference in new issue