mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Revert "Debugging: Add PIOS_DEBUG_Panic() call wen an UAVObject handle is requested but object is uninitialized, make PiOS.posix bail in case of a Panic with an error message"
We do not want to panic in this case as we want the ability to detect if
objects exist at run time
This reverts commit 78e42470d4
.
This commit is contained in:
parent
482bec497b
commit
ced29e221e
@ -79,15 +79,8 @@ void PIOS_DEBUG_Panic(const char *msg)
|
||||
PIOS_COM_SendFormattedStringNonBlocking(PIOS_COM_DEBUG, "\r%s @0x%x\r", msg, lr);
|
||||
#endif
|
||||
|
||||
// tell the user whats going on on commandline too
|
||||
fprintf(stderr,"CRITICAL ERROR: %s\n",msg);
|
||||
|
||||
// this helps debugging: causing a div by zero allows a backtrace
|
||||
// and/or ends execution
|
||||
int b = 0;
|
||||
int a = (2/b);
|
||||
b=a;
|
||||
|
||||
// Stay put
|
||||
while (1) ;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "$(NAMELC).h"
|
||||
|
||||
// Private variables
|
||||
static UAVObjHandle handle = NULL;
|
||||
static UAVObjHandle handle;
|
||||
|
||||
/**
|
||||
* Initialize object.
|
||||
@ -103,7 +103,6 @@ $(INITFIELDS)
|
||||
*/
|
||||
UAVObjHandle $(NAME)Handle()
|
||||
{
|
||||
if (!handle) PIOS_DEBUG_Panic("$(NAME) used uninitialized");
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user