tcMenu
tcMenuVersion.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 https://www.thecoderscorner.com (Nutricherry LTD).
3  * This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4  */
5 
10 #ifndef TCMENU_VERSION_H
11 #define TCMENU_VERSION_H
12 
13 #include "tcUtil.h"
14 
15 namespace tccore {
16 
17 // here we define the version as both a string and separate field
18 #define TCMENU_MAJOR 2
19 #define TCMENU_MINOR 1
20 #define TCMENU_PATCH 3
21 
25 #define majorminor(maj, min) ((maj * 100) + min)
26 
30 #define API_VERSION majorminor(TCMENU_MAJOR, TCMENU_MINOR)
31 
32  inline void copyTcMenuVersion(char* buffer, size_t bufferSize) {
33  buffer[0] = 'V'; buffer[1]=0;
34  fastltoa(buffer, TCMENU_MAJOR, 3, NOT_PADDED, bufferSize);
35  appendChar(buffer, '.', bufferSize);
36  fastltoa(buffer, TCMENU_MINOR, 3, NOT_PADDED, bufferSize);
37  appendChar(buffer, '.', bufferSize);
38  fastltoa(buffer, TCMENU_PATCH, 3, NOT_PADDED, bufferSize);
39  }
40 
41 }
42 
43 #endif //TCMENU_VERSION_H
void fastltoa(char *str, long val, uint8_t dp, char padChar, int len)
Definition: tcUtil.cpp:41
Definition: tcMenuVersion.h:15
void appendChar(char *str, char val, int len)
Definition: tcUtil.cpp:10