Skip to content

Commit

Permalink
Add simple test for external watchdog timer
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickKa committed Nov 11, 2023
1 parent 4a7fe24 commit 4b4fac5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tests/HardwareTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ target_link_libraries(Sts1CobcSwTests_Spi PRIVATE etl::etl rodos::rodos type_saf
add_program(Uart Uart.test.cpp)
target_link_libraries(Sts1CobcSwTests_Uart PRIVATE rodos::rodos Sts1CobcSw_Hal)

add_program(Watchdog Watchdog.test.cpp)
target_link_libraries(Sts1CobcSwTests_Watchdog PRIVATE rodos::rodos Sts1CobcSw_Hal)

get_property(
top_level_hw_test_targets
DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
Expand Down
27 changes: 27 additions & 0 deletions Tests/HardwareTests/Watchdog.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <Sts1CobcSw/Hal/GpioPin.hpp>
#include <Sts1CobcSw/Hal/IoNames.hpp>

#include <rodos_no_using_namespace.h>


namespace sts1cobcsw
{
auto ledGpio = hal::GpioPin(hal::led1Pin);


class WatchdogTest : public RODOS::StaticThread<>
{
void init() override
{
ledGpio.Direction(hal::PinDirection::out);
}


void run() override
{
ledGpio.Reset();
RODOS::AT(RODOS::NOW() + 800 * RODOS::MILLISECONDS);
ledGpio.Set();
}
} watchdogTest;
}

0 comments on commit 4b4fac5

Please sign in to comment.