Add read_version() to convert version string to numbers

read_version() takes a version string in format "x.y.z" with x being
major, y minor, and z patch number. It transforms reads them into
separate numbers, and outputs in the correspondingly named variables.
This commit is contained in:
Robert Schmidt
2024-01-18 15:01:28 +01:00
parent 2b717d4920
commit d89dfafb51
2 changed files with 22 additions and 0 deletions
+4
View File
@@ -107,6 +107,10 @@ void set_priority(int priority);
char *itoa(int i);
#define STRINGIFY(S) #S
#define TO_STRING(S) STRINGIFY(S)
int read_version(const char *version, uint8_t *major, uint8_t *minor, uint8_t *patch);
#define findInList(keY, result, list, element_type) {\
int i;\
for (i=0; i<sizeof(list)/sizeof(element_type) ; i++)\