Choco OS  V.0.16.9.0
Join to the chocolate world
oc_errors.c File Reference

FILE__DESCRIPTION More...

#include <oc_errors.h>
#include <oc_array.h>
#include <oc_null.h>
#include <stdio.h>
#include <stdint.h>
#include <oc_system_cfg.h>
#include <oc_pixel.h>

Go to the source code of this file.

Data Structures

struct  SavedError_t
 

Functions

const char * oC_GetErrorString (oC_ErrorCode_t ErrorCode)
 
bool oC_SaveErrorFunction (const char *Description, oC_ErrorCode_t ErrorCode, const char *Function, uint32_t LineNumber)
 save error code with description for later More...
 
bool oC_ReadLastError (const char **outDescription, oC_ErrorCode_t *outErrorCode, const char **outFunction, uint32_t *outLineNumber)
 reads error code with description from the errors stack
 
void oC_SetLockSavingErrors (bool Lock)
 locks or unlocks saving errors
 

Variables

static const char * oC_ErrorsStrings []
 

Detailed Description


Changing the Hardware On Click Operating System (ChOC)

Author
Patryk Kubiak - (Created on: 9 gru 2014 12:21:22)
Note
Copyright (C) 2014 Patryk Kubiak patry.nosp@m.k.ku.nosp@m.biak9.nosp@m.0@gm.nosp@m.ail.c.nosp@m.om
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

Definition in file oc_errors.c.

Function Documentation

const char* oC_GetErrorString ( oC_ErrorCode_t  ErrorCode)

The function returns string of the error code, if it exists.

Parameters
ErrorCode
Returns
reference to the error string

Definition at line 115 of file oc_errors.c.

bool oC_SaveErrorFunction ( const char *  Description,
oC_ErrorCode_t  ErrorCode,
const char *  Function,
uint32_t  LineNumber 
)
Parameters
Descriptionany description of the error (it must be stored in flash, because the string is not copied)
ErrorCodecode of error to save
Returns
true if success, false if there is no more place

Definition at line 139 of file oc_errors.c.

Variable Documentation

const char* oC_ErrorsStrings[]
static
Initial value:
= {
"Success" ,
oC_ERRORS_LIST(_ADD_ERROR_TO_STRING_LIST)
"Unknown error code"
}

List of error strings

Definition at line 82 of file oc_errors.c.