Added LED Controller module.

This commit is contained in:
jakeg00dwin 2024-08-21 19:59:14 -07:00
parent de01c33f8e
commit a77e544358
7 changed files with 92 additions and 0 deletions

View File

@ -52,3 +52,4 @@ endif()
add_subdirectory(RegEdit) add_subdirectory(RegEdit)
add_subdirectory(usart) add_subdirectory(usart)
add_subdirectory(timer) add_subdirectory(timer)
add_subdirectory(LedController)

View File

@ -0,0 +1,7 @@
add_library(LedController STATIC
LedController.c
)
target_include_directories(LedController PUBLIC
${CMAKE_CURRENT_LIST_DIR}
)

View File

@ -0,0 +1,11 @@
/*
* Author: Jake G
* Date: 2024
* filename: LedController.c
* description: Abstract LED interface and control.
*/
#include "LedController.h"

View File

@ -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

View File

@ -1,6 +1,7 @@
project(Tests) project(Tests)
# TEST_DIRS # TEST_DIRS
add_subdirectory(LedController)
add_subdirectory(timer) add_subdirectory(timer)
#add_subdirectory(usart) #add_subdirectory(usart)
add_subdirectory(MockRegEdit) add_subdirectory(MockRegEdit)
@ -20,6 +21,7 @@ target_link_libraries(AllTests
${CPPUTEST_LIBRARIES}/libCppUTest.a ${CPPUTEST_LIBRARIES}/libCppUTest.a
${CPPUTEST_LIBRARIES}/libCppUTestExt.a ${CPPUTEST_LIBRARIES}/libCppUTestExt.a
# TEST_LINKS # TEST_LINKS
test_LedController
test_timer test_timer
test_RegEdit test_RegEdit
simple_test simple_test

View File

@ -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
)

View File

@ -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);
}