Skip to content

Commit

Permalink
Fix logging for simu
Browse files Browse the repository at this point in the history
  • Loading branch information
Siméon Marijon committed May 1, 2020
1 parent f143099 commit b487ca3
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 18 deletions.
19 changes: 7 additions & 12 deletions sources/include/log_timings.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,16 @@
#define LOG_TIME_TASK_CONTROLLER 0x2
#define LOG_TIME_TASK_HMI 0x3


typedef struct
{
uint8_t id; /* id: MSB=1 start, else end. 7 low bits = id. */
uint16_t date; /* date in us from TIM6. there are overflows */
} log_time_entry;

#ifdef LOG_TIME
#include <FreeRTOS.h>
#include <task.h> /*we need TaskHandle_t */

#ifdef native
void log_time_initHw() {}
void log_time_start() {}
void log_time_event(int id) {UNUSED(id);}
void log_time_dump() {}
int log_time_full() {return 0;}

void log_time_init_task(const char *name, int id) {UNUSED(name); UNUSED(id) ;}
void log_time_event_task(TaskHandle_t t,int start) {UNUSED(t) ; UNUSED(start);}
#else /* stm32 target => implementation in lowlevel/stm32f303/log_timings.h */
void log_time_initHw();
void log_time_start();
void log_time_event(int id);
Expand All @@ -54,7 +50,6 @@

void log_time_init_task(const char *name, int id);
void log_time_event_task(TaskHandle_t t,int start);
#endif /* native */

/* should be called */
#define LOG_TIME_INIT_TIM6_HARDWARE() log_time_initHw();
Expand Down
6 changes: 0 additions & 6 deletions sources/platforms/recovid_revB/log_timings.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
#include "common.h"
#include <string.h> /* strlen */

typedef struct
{
uint8_t id; /* id: MSB=1 start, else end. 7 low bits = id. */
uint16_t date; /* date in us from TIM6. there are overflows */
} log_time_entry;

/* save logs before sending externally (through uart..)*/
/* 3 bytes per entry */
volatile log_time_entry log_time_tab[LOG_TIME_SIZE];
Expand Down
1 change: 1 addition & 0 deletions sources/platforms/simu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ add_library(simu OBJECT
time.c
uart.c
main.c
log_timings.c
)

if(NOT CMAKE_HOST_WIN32)
Expand Down
41 changes: 41 additions & 0 deletions sources/platforms/simu/log_timings.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <stdint.h>
#include <stdio.h>
#include "log_timings.h"
#include "common.h"
#include <string.h> /* strlen */



//TO NOT IMPLEMENTED
void log_time_initHw(){
}

//TO NOT IMPLEMENTED
void log_time_event(int id)
{
}

//TO NOT IMPLEMENTED
void log_time_start()
{
}

//TO NOT IMPLEMENTED
void log_time_dump()
{
}

//TO NOT IMPLEMENTED
int log_time_full()
{
}

//TO NOT IMPLEMENTED
void log_time_init_task(const char *name, int id)
{
}

//TO NOT IMPLEMENTED
void log_time_event_task(TaskHandle_t t,int start)
{
}

0 comments on commit b487ca3

Please sign in to comment.