Fixed simulator. Needs testing.

This commit is contained in:
Fabien Poussin 2017-03-24 01:59:14 +01:00
parent 270d3a263d
commit be581044a5
3 changed files with 13 additions and 9 deletions

3
.gitignore vendored
View File

@ -1,7 +1,8 @@
.svn* .svn*
.dep* .dep*
*.o.d *.o.d
*.o
build/ build/
Debug_EMS/ Debug_EMS/
Release_EMS/ Release_EMS/
Debug/ Debug/

View File

@ -121,8 +121,8 @@ static void sayHello(void) {
*/ */
static void cmd_threads(void) { static void cmd_threads(void) {
#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__) #if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
static const char *states[] = { THD_STATE_NAMES }; static const char *states[] = { CH_STATE_NAMES };
Thread *tp; thread_t *tp;
scheduleMsg(&logger, " addr stack prio refs state time"); scheduleMsg(&logger, " addr stack prio refs state time");
tp = chRegFirstThread(); tp = chRegFirstThread();

View File

@ -15,14 +15,17 @@
#include "histogram.h" #include "histogram.h"
/**
* Unfortunately ChibiOS has two versions of methods for different
* contexts.
*/
#ifndef SIMULATOR
#define isLocked() (ch.dbg.lock_cnt > 0) #define isLocked() (ch.dbg.lock_cnt > 0)
/**
* Unfortunately ChibiOS has two versions of methods for different
* contexts.
*/
#define isIsrContext() (ch.dbg.isr_cnt > 0) #define isIsrContext() (ch.dbg.isr_cnt > 0)
#else
#define isLocked() (0)
#define isIsrContext() (0)
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"