Skip to content

Commit c18a7bf

Browse files
author
Max 'MaxMax' Mönikes
committed
Terminal Software Changes
1 parent bca614e commit c18a7bf

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

examples/Terminal_Interface/Terminal_Interface.ino

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The following commands are implemented:\n \
5555

5656
void setup() {
5757
Serial.begin(115200); //Start Console interface
58-
tle9012.init(&Serial2, 2000000,RXPIN,TXPIN); //Initialize driver with 2Mbit
58+
tle9012.init(&Serial1, 1000000,0,0); //Initialize driver with 2Mbit
5959
}
6060

6161
void loop() {
@@ -136,6 +136,7 @@ void interpretCommand(const char commandbuffer[], uint8_t bufferlength)
136136

137137
if(sscanf(commandbuffer,"%s",cmd) == 1) //Read command
138138
{
139+
Serial.write(commandbuffer,bufferlength);
139140
if(!strcmp(cmd,"IL")) //Emulate IL Command (no function because no ring bus mode is supported by this library)
140141
{
141142
Serial.println("IL OK");
@@ -156,7 +157,12 @@ void interpretCommand(const char commandbuffer[], uint8_t bufferlength)
156157
iso_uart_status_t status = tle9012.writeRegisterSingle(dev_address, reg_address, data);
157158
if(status == isoUART_OK)
158159
{
159-
Serial.println("OK 8000");
160+
Serial.print("WL ");
161+
Serial.print(" ");
162+
Serial.print(dev_address,HEX);
163+
Serial.print(" ");
164+
Serial.print(reg_address, HEX);
165+
Serial.println(" OK 8000");
160166
}
161167
if(status == isoUART_TIMEOUT)
162168
{
@@ -185,6 +191,11 @@ void interpretCommand(const char commandbuffer[], uint8_t bufferlength)
185191
iso_uart_status_t status = tle9012.readRegisterSingle(dev_address, reg_address, &data);
186192
if(status == isoUART_OK)
187193
{
194+
Serial.print("RL ");
195+
Serial.print(dev_address,HEX);
196+
Serial.print(" ");
197+
Serial.print(reg_address,HEX);
198+
Serial.print(" ");
188199
Serial.print(data,HEX);
189200
Serial.print(" OK ");
190201
Serial.println("8000");

0 commit comments

Comments
 (0)