Added LED Controller module.
This commit is contained in:
parent
de01c33f8e
commit
a77e544358
|
@ -52,3 +52,4 @@ endif()
|
|||
add_subdirectory(RegEdit)
|
||||
add_subdirectory(usart)
|
||||
add_subdirectory(timer)
|
||||
add_subdirectory(LedController)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
add_library(LedController STATIC
|
||||
LedController.c
|
||||
)
|
||||
|
||||
target_include_directories(LedController PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Author: Jake G
|
||||
* Date: 2024
|
||||
* filename: LedController.c
|
||||
* description: Abstract LED interface and control.
|
||||
*/
|
||||
|
||||
#include "LedController.h"
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* @brief Led Controller module
|
||||
* @details This file outputs a byte of data to the pins for led indication.
|
||||
* @author Jake G
|
||||
* @date 2024-08-21
|
||||
* @copyright None
|
||||
* @file LEDCONTROLLER.h
|
||||
*/
|
||||
|
||||
#ifndef LEDCONTROLLER
|
||||
#define LEDCONTROLLER
|
||||
|
||||
|
||||
/**
|
||||
* A function that adds two to a number
|
||||
* @param a The first argument
|
||||
*/
|
||||
int add_two(int a);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //LEDCONTROLLER
|
|
@ -1,6 +1,7 @@
|
|||
project(Tests)
|
||||
|
||||
# TEST_DIRS
|
||||
add_subdirectory(LedController)
|
||||
add_subdirectory(timer)
|
||||
#add_subdirectory(usart)
|
||||
add_subdirectory(MockRegEdit)
|
||||
|
@ -20,6 +21,7 @@ target_link_libraries(AllTests
|
|||
${CPPUTEST_LIBRARIES}/libCppUTest.a
|
||||
${CPPUTEST_LIBRARIES}/libCppUTestExt.a
|
||||
# TEST_LINKS
|
||||
test_LedController
|
||||
test_timer
|
||||
test_RegEdit
|
||||
simple_test
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# TEST_RUNNER
|
||||
add_library(test_LedController
|
||||
test_LedController.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(test_LedController
|
||||
${CPPUTEST_LIBRARIES}/libCppUTest.a
|
||||
${CPPUTEST_LIBRARIES}/libCppUTestExt.a
|
||||
LedController
|
||||
)
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Author: username
|
||||
* Date: todays_date
|
||||
* filename: test_LedController.c
|
||||
* description: module_purpose
|
||||
*/
|
||||
|
||||
#include "CppUTest/CommandLineTestRunner.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "LedController.h"
|
||||
}
|
||||
|
||||
TEST_GROUP(test_LedController)
|
||||
{
|
||||
void setup()
|
||||
{
|
||||
|
||||
}
|
||||
void teardown()
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
TEST(test_LedController, FirstTest)
|
||||
{
|
||||
FAIL("Fail me!");
|
||||
}
|
||||
|
||||
TEST(test_LedController, SecondTest)
|
||||
{
|
||||
STRCMP_EQUAL("hello", "world");
|
||||
LONGS_EQUAL(1, 2);
|
||||
CHECK(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue