Skip to content

Commit 214fa32

Browse files
author
Max 'MaxMax' Mönikes
committed
Added Helppage to Terminal Example
1 parent 5daec72 commit 214fa32

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

examples/Terminal_Interface/Terminal_Interface.ino

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/*
2+
MIT License
3+
4+
Copyright (c) 2024 Maximilian Mönikes
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
*/
24+
25+
126
#include "TLE9012.h"
227
#include <stdio.h>
328

@@ -15,6 +40,18 @@ uint32_t last_wd_trigger = 0;
1540
uint8_t terminalbufferrecvlen = 0;
1641
char terminalbuffer[64];
1742

43+
//constants
44+
const char helppage[] =
45+
46+
"Arduino based UART-isoUART Bridge v1\n \
47+
The following commands are implemented:\n \
48+
\n\
49+
-IL: no function, only exists for compatibility reasons\n\
50+
-IH: no function, only exists for compatibility reasons\n\
51+
-WH/WL device_address register_address data : Write data to a register\n\
52+
-RH/RL device_address register_address : Read data from a register\n\
53+
-K update_rate : Reset Watchdog every update_rate interval in milliseconds\n\
54+
-? Show Manual\n";
1855

1956
void setup() {
2057
Serial.begin(115200); //Start Console interface
@@ -187,6 +224,12 @@ void interpretCommand(const char commandbuffer[], uint8_t bufferlength)
187224
}
188225
}
189226
}
227+
228+
else if(!strcmp(cmd,"?")) //Print Helppage
229+
{
230+
Serial.print(helppage);
231+
}
232+
190233
else //No valid command was detected
191234
{
192235
Serial.println("INVALID COMMAND");

0 commit comments

Comments
 (0)