PHS module SMA-01 library. see: https://developer.mbed.org/users/phsfan/notebook/abitusbmodem/
Dependencies: Socket lwip-sys lwip
Dependents: AbitUSBModem_HTTPTest AbitUSBModem_MQTTTest AbitUSBModem_WebsocketTest AbitUSBModem_SMSTest
Fork of VodafoneUSBModem by
core/dbg.h@16:02db4f537955, 2012-07-27 (annotated)
- Committer:
- donatien
- Date:
- Fri Jul 27 16:19:15 2012 +0000
- Revision:
- 16:02db4f537955
Loads of optimization in the USB code. Memory optimization throughout the stack.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 16:02db4f537955 | 1 | /* dbg.h */ |
donatien | 16:02db4f537955 | 2 | /* Copyright (C) 2012 mbed.org, MIT License |
donatien | 16:02db4f537955 | 3 | * |
donatien | 16:02db4f537955 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
donatien | 16:02db4f537955 | 5 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
donatien | 16:02db4f537955 | 6 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
donatien | 16:02db4f537955 | 7 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
donatien | 16:02db4f537955 | 8 | * furnished to do so, subject to the following conditions: |
donatien | 16:02db4f537955 | 9 | * |
donatien | 16:02db4f537955 | 10 | * The above copyright notice and this permission notice shall be included in all copies or |
donatien | 16:02db4f537955 | 11 | * substantial portions of the Software. |
donatien | 16:02db4f537955 | 12 | * |
donatien | 16:02db4f537955 | 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
donatien | 16:02db4f537955 | 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
donatien | 16:02db4f537955 | 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
donatien | 16:02db4f537955 | 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
donatien | 16:02db4f537955 | 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
donatien | 16:02db4f537955 | 18 | */ |
donatien | 16:02db4f537955 | 19 | |
donatien | 16:02db4f537955 | 20 | #ifndef DBG_H_ |
donatien | 16:02db4f537955 | 21 | #define DBG_H_ |
donatien | 16:02db4f537955 | 22 | |
donatien | 16:02db4f537955 | 23 | #ifdef __cplusplus |
donatien | 16:02db4f537955 | 24 | extern "C" { |
donatien | 16:02db4f537955 | 25 | #endif |
donatien | 16:02db4f537955 | 26 | |
donatien | 16:02db4f537955 | 27 | |
donatien | 16:02db4f537955 | 28 | void debug_init(void); |
donatien | 16:02db4f537955 | 29 | void debug(int level, const char* module, int line, const char* fmt, ...); |
donatien | 16:02db4f537955 | 30 | void debug_set_newline(const char* newline); |
donatien | 16:02db4f537955 | 31 | void debug_set_speed(int speed); |
donatien | 16:02db4f537955 | 32 | void debug_error(const char* module, int line, int ret); |
donatien | 16:02db4f537955 | 33 | void debug_exact(const char* fmt, ...); |
donatien | 16:02db4f537955 | 34 | |
donatien | 16:02db4f537955 | 35 | #define DBG_INIT() do{ debug_init(); }while(0) |
donatien | 16:02db4f537955 | 36 | |
donatien | 16:02db4f537955 | 37 | #define DBG_SET_NEWLINE( x ) do{ debug_set_newline(x); }while(0) |
donatien | 16:02db4f537955 | 38 | |
donatien | 16:02db4f537955 | 39 | #define DBG_SET_SPEED( x ) do{ debug_set_speed(x); }while(0) |
donatien | 16:02db4f537955 | 40 | |
donatien | 16:02db4f537955 | 41 | #if __DEBUG__ > 0 |
donatien | 16:02db4f537955 | 42 | #ifndef __MODULE__ |
donatien | 16:02db4f537955 | 43 | #error "__MODULE__ must be defined" |
donatien | 16:02db4f537955 | 44 | #endif |
donatien | 16:02db4f537955 | 45 | #endif |
donatien | 16:02db4f537955 | 46 | |
donatien | 16:02db4f537955 | 47 | #if __DEBUG__ >= 1 |
donatien | 16:02db4f537955 | 48 | #define ERR(...) do{ debug(1, __MODULE__, __LINE__, __VA_ARGS__); }while(0) |
donatien | 16:02db4f537955 | 49 | #else |
donatien | 16:02db4f537955 | 50 | #define ERR(...) do{ }while(0) |
donatien | 16:02db4f537955 | 51 | #endif |
donatien | 16:02db4f537955 | 52 | |
donatien | 16:02db4f537955 | 53 | #if __DEBUG__ >= 2 |
donatien | 16:02db4f537955 | 54 | #define WARN(...) do{ debug(2, __MODULE__, __LINE__, __VA_ARGS__); }while(0) |
donatien | 16:02db4f537955 | 55 | #else |
donatien | 16:02db4f537955 | 56 | #define WARN(...) do{ }while(0) |
donatien | 16:02db4f537955 | 57 | #endif |
donatien | 16:02db4f537955 | 58 | |
donatien | 16:02db4f537955 | 59 | #if __DEBUG__ >= 3 |
donatien | 16:02db4f537955 | 60 | #define INFO(...) do{ debug(3, __MODULE__, __LINE__, __VA_ARGS__); }while(0) |
donatien | 16:02db4f537955 | 61 | #define CHECK(ret) do{ if(ret){ debug_error(__MODULE__, __LINE__, ret); } }while(0) |
donatien | 16:02db4f537955 | 62 | #else |
donatien | 16:02db4f537955 | 63 | #define INFO(...) do{ }while(0) |
donatien | 16:02db4f537955 | 64 | #define CHECK(ret) do{ }while(0) |
donatien | 16:02db4f537955 | 65 | #endif |
donatien | 16:02db4f537955 | 66 | |
donatien | 16:02db4f537955 | 67 | #if __DEBUG__ >= 4 |
donatien | 16:02db4f537955 | 68 | #define DBG(...) do{ debug(4, __MODULE__, __LINE__, __VA_ARGS__); }while(0) |
donatien | 16:02db4f537955 | 69 | #define DBGX(...) do{ debug_exact(__VA_ARGS__); }while(0) |
donatien | 16:02db4f537955 | 70 | #else |
donatien | 16:02db4f537955 | 71 | #define DBG(...) do{ }while(0) |
donatien | 16:02db4f537955 | 72 | #define DBGX(...) do{ }while(0) |
donatien | 16:02db4f537955 | 73 | #endif |
donatien | 16:02db4f537955 | 74 | |
donatien | 16:02db4f537955 | 75 | #ifdef __cplusplus |
donatien | 16:02db4f537955 | 76 | } |
donatien | 16:02db4f537955 | 77 | #endif |
donatien | 16:02db4f537955 | 78 | |
donatien | 16:02db4f537955 | 79 | #endif /* DBG_H_ */ |