diff --git a/firmware/console_util/rfiutil.c b/firmware/console_util/rfiutil.c deleted file mode 100644 index ca5a6c32b8..0000000000 --- a/firmware/console_util/rfiutil.c +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file rfiutil.c - * @brief Number to string conversion code - * - * @date Nov 15, 2012 - * @author Andrey Belomutskiy, (c) 2012-2016 - * - * This file is part of rusEfi - see http://rusefi.com - * - * rusEfi is free software; you can redistribute it and/or modify it under the terms of - * the GNU General Public License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with this program. - * If not, see . - */ - -#include -#include "main.h" -#include "rfiutil.h" - -/* - not used, not sure if we still need it. I guess we will remove it in 2015 - int mylog10(int param) { - if (param < 10) - return 0; - if (param < 100) - return 1; - if (param < 1000) - return 2; - if (param < 10000) - return 3; - if (param < 100000) - return 4; - if (param < 1000000) - return 5; - if (param < 10000000) - return 6; - if (param < 100000000) - return 7; - #warning This would be better without recursion - return mylog10(param / 10) + 1; - } - */ -/* - char hexChar(int v) { - v = v & 0xF; - if (v < 10) - return (char)('0' + v); - return 'A' - 10 + v; - } - */ - -void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par) { - bool wasLocked = lockAnyContext(); - - /** - * todo: this could be simplified once we migrate to ChibiOS 3.0 - * See http://www.chibios.org/dokuwiki/doku.php?id=chibios:howtos:porting_from_2_to_3 - */ - if (chVTIsArmedI(vtp)) { - chVTResetI(vtp); - } - - chVTSetI(vtp, time, vtfunc, par); - if (!wasLocked) { - unlockAnyContext(); - } -} diff --git a/firmware/console_util/rfiutil.h b/firmware/console_util/rfiutil.h deleted file mode 100644 index e19712e7a5..0000000000 --- a/firmware/console_util/rfiutil.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * @file rfiutil.h - * @brief Number to string conversion header - * - * @date Nov 15, 2012 - * @author Andrey Belomutskiy, (c) 2012-2016 - */ - -#ifndef RFIUTIL_H_ -#define RFIUTIL_H_ - -#include "global.h" -#include "histogram.h" - -#define isLocked() (dbg_lock_cnt > 0) - - /** - * Unfortunately ChibiOS has two versions of methods for different - * contexts. - */ - -#define isIsrContext() (dbg_isr_cnt > 0) - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -//char hexC(int v); -void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par); - -#ifdef __cplusplus -} -void printHistogram(Logging *logging, histogram_s *histogram); -#endif /* __cplusplus */ - -#endif /* RFIUTIL_H_ */ diff --git a/firmware/iar/ch.ewp b/firmware/iar/ch.ewp index 153faea7e7..0ec152b35c 100644 --- a/firmware/iar/ch.ewp +++ b/firmware/iar/ch.ewp @@ -2173,15 +2173,6 @@ $PROJ_DIR$\..\console\status_loop.h - - console_util - - $PROJ_DIR$\..\console_util\rfiutil.c - - - $PROJ_DIR$\..\console_util\rfiutil.h - - controllers @@ -2265,7 +2256,7 @@ $PROJ_DIR$\..\controllers\algo\main_trigger_callback.h - $PROJ_DIR$\..\controllers\algo\malfunction_central.c + $PROJ_DIR$\..\controllers\algo\malfunction_central.cpp $PROJ_DIR$\..\controllers\algo\malfunction_central.h @@ -3333,6 +3324,12 @@ util + + $PROJ_DIR$\..\util\rfiutil.c + + + $PROJ_DIR$\..\util\rfiutil.h + $PROJ_DIR$\..\util\cli_registry.cpp