Bayley Wang
/
pyroflex_AND
control the laser with the MBED
CommandProcessor/cmd_helpers.cpp
- Committer:
- bwang
- Date:
- 2019-11-11
- Revision:
- 1:d42ef49f54df
File content as of revision 1:d42ef49f54df:
#include "mbed.h" #include "CommandProcessor.h" #include "prefs.h" int tokenize(char *buf, char **out, int max) { char* tok; int k = 0; tok = strtok(buf, " "); while(tok != NULL && k < max) { out[k] = tok; k++; tok = strtok(NULL, " "); } return k; } #define __check(x) if(strcmp(s, #x) == 0) return &_##x #define __check2(x) if (strcmp(s, #x) == 0) return &x float* checkf(char *s) { return NULL; } int* checkn(char *s) { __check(PULSE_WIDTH); __check(PULSE_FREQ); return NULL; }