Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
Diff: internal/common.h
- Revision:
- 26:8067e3d463d3
- Parent:
- 17:7268f365676b
- Child:
- 27:b63f5a9cdefa
diff -r 2d7ef60a9f2a -r 8067e3d463d3 internal/common.h --- a/internal/common.h Tue Aug 26 16:53:06 2014 -0700 +++ b/internal/common.h Thu Oct 23 15:16:06 2014 -0700 @@ -72,10 +72,29 @@ return WICONNECT_ANOTHER_CMD_EXECUTING; \ } \ } - + +#define _CHECK_CLEANUP_COMMAND() \ + if(result != WICONNECT_PROCESSING) \ + { \ + internalProcessingState = 0; \ + currentCommandId = NULL; \ + } + +#define _CHECK_OTHER_COMMAND_EXECUTING() \ +{ \ + static const volatile uint8_t __funcId = 0; \ + if(currentCommandId == NULL) \ + { \ + currentCommandId = (void*)&__funcId; \ + } \ + else if(currentCommandId != (void*)&__funcId) \ + { \ + return WICONNECT_ANOTHER_CMD_EXECUTING; \ + } \ +} #define WICONNECT_IS_IDLE() (wiconnect->currentCommandId == NULL) - +#define _WICONNECT_IS_IDLE() (currentCommandId == NULL)