datasheetbank_Logo
Технический паспорт Поисковая и бесплатно техническое описание Скачать

AN672 Просмотр технического описания (PDF) - Silicon Laboratories

Номер в каталоге
Компоненты Описание
Список матч
AN672
Silabs
Silicon Laboratories Silabs
AN672 Datasheet PDF : 30 Pages
1 2 3 4 5 6 7 8 9 10 Next Last
AN672
si32LogBeIndented(yn), prepends "ERROR: " and appends a newline.
void si32LogPrologue(void): Logs the name of the surrounding function preceded by ">" and indented
per si32LogBeIndented(yn). Useful for marking function entry. Intended to be paired with
si32LogEpilogue() particularly when preceded by si32LogBeIndented(YES).
void si32LogEpilogue(void): Logs the name of the surrounding function preceded by "<" and indented
per si32LogBeIndented(yn). Useful for marking function exit. Intended to be paired with si32LogPrologue()
particularly when preceded by si32LogBeIndented(YES).
5.3. Error Handling
Error handling in si32Library adopts the strategy of storing an error code, with a get/set error methodology. This
style is chosen over the "error out parameter" style in order to reduce the number of parameters to functions in the
general case, improving the compiler's opportunity to pass parameters via registers. The error code is a char*, not
an integer code, and points to a non-localized string. Error strings are intended specifically to aid the developer in
debugging the application. These entry points are all macros.
si32Assert(expression): Evaluates an expression and "halts" if that expression evaluates to false.
si32If (expression) { handler statements }: If the expression is true, sets an error with the text of the
expression, and executes the handler statements. It is 'if', but with internal error check, set, and log
functionality. Use it just like 'if'.
IF (expression) { handler statements }: Identical to si32If, but intended to be less disruptive when
reading code.
si32BreakIf(expression): Conditional break statement.
si32ContinueIf(expression): Conditional continue statement.
si32Catch(exception): Control flow escape for local exception handing. Catches a local throw from within
the same function.
si32Throw(exception): Control flow escape for local exception handing. Throws to the corresponding
catch within the same function.
si32ThrowExitIf(expression): Conditional throw to 'exit'.
si32ThrowIf(expression, exception): Similar to si32ThrowTrapIf except instead of throwing 'trap' it throws
the specified exception, and does not specify an error string.
si32ThrowTrapIf(expression): Conditional throw to 'trap'. Evaluates an expression and throws a trap
exception if that expression evaluates to true.
si32TrapIf(expression): Synonymous with si32ThrowTrapIf. si32TrapIf is deprecated but still exists for
compatibility with vintage code.
si32Halt(): Halts, triggering a debugger breakpoint if possible, or simulates one via while(1).
bool si32SetError(fmt, ...): Logs and pushes an error. Error stack depth is implementation dependent, and
varies across embedded and workstation targets. StdC implementations are 1 deep. ObjC implementations
are deeper. Parameters work like printf. Current implementations always return YES.
char* si32GetError(): Peeks the current error. I.e, returns the error string but does not pop the error stack.
si32ClearError: For embedded StdC implementation, clears the current error. For ObjC implementations,
pops the error stack.
6
Rev. 0.1

Share Link: 

datasheetbank.com [ Privacy Policy ] [ Request Datasheet ] [ Contact Us ]