-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pitch and yaw not working -runs into segmentation fault after a few seconds
- Loading branch information
1 parent
0c68d23
commit b051aab
Showing
7 changed files
with
120 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef DEBUGGER_H | ||
#define DEBUGGER_H | ||
|
||
#include "bsp_uart.h" | ||
#include "bsp_daemon.h" | ||
#include "bsp_serial.h" | ||
|
||
#define DEBUGGER_DATA_RX_BUFER_SIZE (1) | ||
#define DEBUGGER_DATA_TX_BUFER_SIZE (1024) | ||
|
||
#define DEBUGGER_TIMEOUT_MS (10000) | ||
#define DEBUGGER_PERIOD (100) | ||
|
||
typedef struct { | ||
uint8_t rx_buffer[DEBUGGER_DATA_RX_BUFER_SIZE]; | ||
uint8_t tx_buffer[DEBUGGER_DATA_TX_BUFER_SIZE]; | ||
} Debugger_Data_t; | ||
|
||
extern Debugger_Data_t g_debugger_data; | ||
void Debugger_Init(UART_HandleTypeDef *huartx); | ||
void Debugger_Log_Data(const char *data, ...); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "debugger.h" | ||
#include "stdarg.h" | ||
|
||
Debugger_Data_t g_debugger_data; | ||
|
||
UART_Instance_t *g_debugger_uart_instance_ptr; | ||
Daemon_Instance_t *g_debugger_daemon_instance_ptr; | ||
|
||
static uint8_t debugger_init = 0; | ||
|
||
void Debugger_Rx_Callback(UART_Instance_t *uart_instance) | ||
{ | ||
return; | ||
} | ||
|
||
void Debugger_Timeout_Callback() | ||
{ | ||
return; | ||
} | ||
|
||
void Debugger_Init(UART_HandleTypeDef *huartx) | ||
{ | ||
debugger_init = 1; | ||
// register UART instance | ||
g_debugger_uart_instance_ptr = UART_Register(huartx, g_debugger_data.rx_buffer, DEBUGGER_DATA_RX_BUFER_SIZE, Debugger_Rx_Callback); | ||
|
||
// register Daemon instance | ||
// timeout is defined in the header file | ||
uint16_t reload_value = DEBUGGER_TIMEOUT_MS / DAEMON_PERIOD; | ||
uint16_t initial_counter = reload_value; | ||
g_debugger_daemon_instance_ptr = Daemon_Register(reload_value, initial_counter, Debugger_Timeout_Callback); | ||
return; | ||
} | ||
|
||
void Debugger_Log_Data(const char *data, ...) | ||
{ | ||
if (debugger_init) | ||
{ | ||
va_list args; | ||
va_start(args, data); | ||
DEBUG_PRINTF(g_debugger_uart_instance_ptr->uart_handle, data, args); | ||
va_end(args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters