mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
Changed PIOS_DEBUG_Panic()
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@694 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
17f6646f6e
commit
a2beb49257
@ -30,7 +30,7 @@
|
|||||||
#include "pios.h"
|
#include "pios.h"
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
const uint8_t* PIOS_DEBUG_AssertMsg = (uint8_t*)"ASSERT FAILED";
|
const char* PIOS_DEBUG_AssertMsg = "ASSERT FAILED";
|
||||||
|
|
||||||
/* Private Function Prototypes */
|
/* Private Function Prototypes */
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ void PIOS_DEBUG_PinLow(uint8_t Pin)
|
|||||||
/**
|
/**
|
||||||
* Report a serious error and halt
|
* Report a serious error and halt
|
||||||
*/
|
*/
|
||||||
void PIOS_DEBUG_Panic(const uint8_t* msg)
|
void PIOS_DEBUG_Panic(const char* msg)
|
||||||
{
|
{
|
||||||
register int *lr asm ("lr"); // Link-register holds the PC of the caller
|
register int *lr asm ("lr"); // Link-register holds the PC of the caller
|
||||||
|
|
||||||
|
@ -26,12 +26,12 @@
|
|||||||
#ifndef PIOS_DEBUG_H
|
#ifndef PIOS_DEBUG_H
|
||||||
#define PIOS_DEBUG_H
|
#define PIOS_DEBUG_H
|
||||||
|
|
||||||
extern const uint8_t* PIOS_DEBUG_AssertMsg;
|
extern const char* PIOS_DEBUG_AssertMsg;
|
||||||
|
|
||||||
void PIOS_DEBUG_Init(void);
|
void PIOS_DEBUG_Init(void);
|
||||||
void PIOS_DEBUG_PinHigh(uint8_t pin);
|
void PIOS_DEBUG_PinHigh(uint8_t pin);
|
||||||
void PIOS_DEBUG_PinLow(uint8_t pin);
|
void PIOS_DEBUG_PinLow(uint8_t pin);
|
||||||
void PIOS_DEBUG_Panic(const uint8_t* msg);
|
void PIOS_DEBUG_Panic(const char* msg);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define PIOS_DEBUG_Assert(test) if (!(test)) PIOS_DEBUG_Panic(PIOS_DEBUG_AssertMsg);
|
#define PIOS_DEBUG_Assert(test) if (!(test)) PIOS_DEBUG_Panic(PIOS_DEBUG_AssertMsg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user