From 5706b084d444a7c9ab437cae718e36b139e6f884 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Fri, 27 Feb 2015 12:04:56 -0600 Subject: [PATCH] auto-sync --- firmware/controllers/algo/error_handling.h | 2 ++ firmware/controllers/error_handling.cpp | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/firmware/controllers/algo/error_handling.h b/firmware/controllers/algo/error_handling.h index aa0794b61f..7c75a20086 100644 --- a/firmware/controllers/algo/error_handling.h +++ b/firmware/controllers/algo/error_handling.h @@ -17,6 +17,8 @@ extern "C" #include "efifeatures.h" #include "stdbool.h" +void assertVtList(void); + /** * Something is wrong, but we can live with it: some minor sensor is disconnected * or something like that diff --git a/firmware/controllers/error_handling.cpp b/firmware/controllers/error_handling.cpp index abbecb4de3..5d866b5d77 100644 --- a/firmware/controllers/error_handling.cpp +++ b/firmware/controllers/error_handling.cpp @@ -106,3 +106,18 @@ void onUnlockHook(void) { void initErrorHandling(void) { msObjectInit(&warningStream, (uint8_t *) warningBuffer, WARNING_BUFFER_SIZE, 0); } + +extern VTList vtlist; +extern bool_t main_loop_started; + +void assertVtList(void) { + if(!main_loop_started) + return; + VirtualTimer *first = vtlist.vt_next; + VirtualTimer *cur = first->vt_next; + int c = 0; + while(c++ < 20 && cur != first) { + cur = cur->vt_next; + } + efiAssertVoid(c > 3, "VT list?"); +}