diff options
author | Evan Lojewski <github@meklort.com> | 2020-10-28 21:04:32 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-28 21:04:32 -0600 |
commit | 7031eabcfcdb606998d5398e22676d2714355596 (patch) | |
tree | c51b8a7d37d6ccff3afe955c4adf306892c43baf /ape | |
parent | 98847d8427bf1a96d268a14f8ebb75cc67c45b60 (diff) | |
download | bcm5719-ortega-7031eabcfcdb606998d5398e22676d2714355596.tar.gz bcm5719-ortega-7031eabcfcdb606998d5398e22676d2714355596.zip |
timer: Add an initial timer library. (#155)
Diffstat (limited to 'ape')
-rw-r--r-- | ape/CMakeLists.txt | 2 | ||||
-rw-r--r-- | ape/main.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ape/CMakeLists.txt b/ape/CMakeLists.txt index 136d924..13f1296 100644 --- a/ape/CMakeLists.txt +++ b/ape/CMakeLists.txt @@ -56,7 +56,7 @@ function(ape_firmware PORT) arm_linker_script(${TARGET} "${CMAKE_CURRENT_SOURCE_DIR}/ape.ld") target_include_directories(${TARGET} PRIVATE include) - target_link_libraries(${TARGET} NVRam-arm MII-arm APE-arm Network-arm NCSI-arm printf-arm) + target_link_libraries(${TARGET} NVRam-arm MII-arm APE-arm Network-arm NCSI-arm Timer-arm printf-arm) target_link_libraries(${TARGET} bcm5719-arm) target_link_libraries(${TARGET} --defsym=NETWORK_PORT=${PORT} @@ -55,6 +55,7 @@ #include <Ethernet.h> #include <NCSI.h> #include <NVRam.h> +#include <Timer.h> #include <ape_main.h> #ifndef CXX_SIMULATOR @@ -227,7 +228,7 @@ void handleBMCPacket(void) // the RMU state machine can enter a stuck state. // This can be seen as an InProgress for an unreasonable amount of time. // In such a case, reset the RMU to recover. - if (APE.Tick1khz.r32 - inProgressStartTime > RMU_WATCHDOG_TIMEOUT_MS) + if (Timer_didTimeElapsed1KHz(inProgressStartTime, RMU_WATCHDOG_TIMEOUT_MS)) { printf("RMU Hang detected, resetting.\n"); initRMU(); @@ -237,7 +238,7 @@ void handleBMCPacket(void) else { packetInProgress = true; - inProgressStartTime = APE.Tick1khz.r32; + inProgressStartTime = Timer_getCurrentTime1KHz(); } } } |