# My Digital Signal Controller Library # The objective of MyDSC library is to implement controllers with help digital signal processors, digital signal controllers or mixed signals processors.
Dependents: mydsc_sampling_example mydsc_sampling_example mydsc-serial-example mydsc-nonblocking-example
include/mydsc_error.h@4:90c3f1288d41, 2020-03-28 (annotated)
- Committer:
- ghsalazar
- Date:
- Sat Mar 28 16:09:15 2020 +0000
- Revision:
- 4:90c3f1288d41
Add error handling
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ghsalazar | 4:90c3f1288d41 | 1 | /** @file: mydsc_error.h |
ghsalazar | 4:90c3f1288d41 | 2 | @author Gastón H. Salazar-Silva <gaston_salazar@yahoo.com> |
ghsalazar | 4:90c3f1288d41 | 3 | |
ghsalazar | 4:90c3f1288d41 | 4 | @brief A very basic error reporting system. |
ghsalazar | 4:90c3f1288d41 | 5 | **/ |
ghsalazar | 4:90c3f1288d41 | 6 | |
ghsalazar | 4:90c3f1288d41 | 7 | #ifndef MYDSC_ERROR_H |
ghsalazar | 4:90c3f1288d41 | 8 | #define MYDSC_ERROR_H |
ghsalazar | 4:90c3f1288d41 | 9 | |
ghsalazar | 4:90c3f1288d41 | 10 | #include <stdint.h> |
ghsalazar | 4:90c3f1288d41 | 11 | |
ghsalazar | 4:90c3f1288d41 | 12 | #ifdef __cplusplus |
ghsalazar | 4:90c3f1288d41 | 13 | extern "C" { |
ghsalazar | 4:90c3f1288d41 | 14 | #endif |
ghsalazar | 4:90c3f1288d41 | 15 | |
ghsalazar | 4:90c3f1288d41 | 16 | |
ghsalazar | 4:90c3f1288d41 | 17 | /// Error conditions on looking-up a key, or trying to setting the value. |
ghsalazar | 4:90c3f1288d41 | 18 | |
ghsalazar | 4:90c3f1288d41 | 19 | typedef enum { |
ghsalazar | 4:90c3f1288d41 | 20 | MYDSC_SUCCESS, |
ghsalazar | 4:90c3f1288d41 | 21 | MYDSC_KVP_NO_SET, |
ghsalazar | 4:90c3f1288d41 | 22 | MYDSC_KVP_NO_KEY, |
ghsalazar | 4:90c3f1288d41 | 23 | MYDSC_KVP_WRONG_VALUE |
ghsalazar | 4:90c3f1288d41 | 24 | } mydsc_errno_t; |
ghsalazar | 4:90c3f1288d41 | 25 | |
ghsalazar | 4:90c3f1288d41 | 26 | extern mydsc_errno_t mydsc_errno; |
ghsalazar | 4:90c3f1288d41 | 27 | |
ghsalazar | 4:90c3f1288d41 | 28 | extern char *mydsc_error[]; |
ghsalazar | 4:90c3f1288d41 | 29 | |
ghsalazar | 4:90c3f1288d41 | 30 | #ifdef __cplusplus |
ghsalazar | 4:90c3f1288d41 | 31 | } |
ghsalazar | 4:90c3f1288d41 | 32 | #endif |
ghsalazar | 4:90c3f1288d41 | 33 | |
ghsalazar | 4:90c3f1288d41 | 34 | #endif // MYDSC_ERROR_H |