Prusa MINI Firmware overview
dbg.h
Go to the documentation of this file.
1 //dbg.h
2 #ifndef _DBG_H
3 #define _DBG_H
4 
5 #include <inttypes.h>
6 #include "config.h"
7 
8 #ifndef DBG_LEVEL
9  #define DBG_LEVEL 0
10 #endif //DBG_LEVEL
11 
12 #if (DBG_LEVEL >= 3)
13  #define _dbg3 _dbg
14 #else //(DBG_LEVEL >= 3)
15  #define _dbg3(...)
16 #endif //(DBG_LEVEL >= 3)
17 
18 #if (DBG_LEVEL >= 2)
19  #define _dbg2 _dbg
20 #else //(DBG_LEVEL >= 2)
21  #define _dbg2(...)
22 #endif //(DBG_LEVEL >= 2)
23 
24 #if (DBG_LEVEL >= 1)
25  #define _dbg1 _dbg
26 #else //(DBG_LEVEL >= 1)
27  #define _dbg1(...)
28 #endif //(DBG_LEVEL >= 1)
29 
30 #if (DBG_LEVEL >= 0)
31  #define _dbg0 _dbg
32 #else //(DBG_LEVEL >= 0)
33  #define _dbg0(...)
34 #endif //(DBG_LEVEL >= 0)
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif //__cplusplus
39 
40 #if defined(DBG_SWO) // trace to SWO
41 extern void _dbg_swo(const char *fmt, ...);
42  #define _dbg _dbg_swo
43 #elif defined(DBG_UART) // trace to UART
44 extern void _dbg_uart(const char *fmt, ...);
45  #define _dbg _dbg_uart
46 #elif defined(DBG_CDC) // trace to CDC
47 extern void _dbg_cdc(const char *fmt, ...);
48  #define _dbg _dbg_cdc
49 #else // trace disabled
50  #define _dbg(...)
51 #endif //
52 
53 extern uint32_t _microseconds(void);
54 
55 #ifdef __cplusplus
56 }
57 #endif //__cplusplus
58 
59 #endif //_DBG_H
osSemaphore
#define osSemaphore(name)
Definition: cmsis_os.h:709
osSemaphoreWait
int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec)
Wait until a Semaphore token becomes available.
Definition: cmsis_os.c:822
_dbg_delay
#define _dbg_delay
Definition: dbg.c:34
_dbg_lock
#define _dbg_lock()
Definition: dbg.c:30
i
uint8_t i
Definition: screen_test_graph.c:72
_dbg_unlock
#define _dbg_unlock()
Definition: dbg.c:32
_microseconds
uint32_t _microseconds(void)
Definition: dbg.c:113
dbg.h
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:55
osSemaphoreId
SemaphoreHandle_t osSemaphoreId
Definition: cmsis_os.h:295
osSemaphoreCreate
osSemaphoreId osSemaphoreCreate(const osSemaphoreDef_t *semaphore_def, int32_t count)
Create and Initialize a Semaphore object used for managing resources.
Definition: cmsis_os.c:755
osSemaphoreDef
#define osSemaphoreDef(name)
Definition: cmsis_os.h:700
osWaitForever
#define osWaitForever
wait forever timeout value
Definition: cmsis_os.h:230
uint8_t
const uint8_t[]
Definition: 404_html.c:3
_microseconds
uint32_t _microseconds(void)
Definition: dbg.c:113
CDC_Transmit_FS
uint8_t CDC_Transmit_FS(uint8_t *Buf, uint16_t Len)
CDC_Transmit_FS Data to send over USB IN endpoint are sent over CDC interface through this function.
Definition: usbd_cdc_if.c:317
usbd_cdc_if.h
: Header for usbd_cdc_if.c file.
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
config.h
DBG_MAXLINE
#define DBG_MAXLINE
Definition: dbg.c:7
HAL_MAX_DELAY
#define HAL_MAX_DELAY
Definition: stm32f4xx_hal_def.h:76
UART_HandleTypeDef
UART handle Structure definition.
Definition: stm32f4xx_hal_uart.h:158
cmsis_os.h
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...
USBD_OK
Definition: usbd_def.h:195
osSemaphoreRelease
osStatus osSemaphoreRelease(osSemaphoreId semaphore_id)
Release a Semaphore token.
Definition: cmsis_os.c:862
HAL_UART_Transmit
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)