Skip to content

Commit dd4ec58

Browse files
authored
Merge branch 'develop' into feature/generic-menu-and-lvgl-implementation
2 parents e50a92d + 6c06330 commit dd4ec58

7 files changed

Lines changed: 59 additions & 14 deletions

File tree

.github/workflows/generate-documentation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: generate and deploy documentation
22

33
on:
4-
push:
5-
branches-ignore:
6-
- 'gh-pages'
4+
workflow_run:
5+
workflows: [Cleanup GitHub Pages Branch Workflow]
6+
types: [completed]
77

88
permissions:
99
contents: write

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,30 @@ Since version 2.1.0 it uses VS Code's built-in terminal instead.
7171
That terminal does not provide a prompt for entering, reviewing and modifying a message before sending it.
7272
See also [this issue report](https://github.com/wokwi/wokwi-features/issues/698).
7373

74-
Serial port forwarding is enabled for the simulator.
75-
Thus a Telnet client can be used to connect to the serial port of the simulator.
74+
The simulator also [provides a RFC2217 TCP server](https://docs.wokwi.com/vscode/project-config#serial-port-forwarding) as an alternative.
75+
Serial port forwarding is enabled for the simulator per configuration.
76+
This can be used to connect via a Telnet client to the serial port of the simulated device.
7677

77-
For example one can use the [PuTTY](https://www.putty.org/) SSH Client in Telnet mode with `localhost` as host and `4000` as port.
78+
For example one may use a [PuTTY](https://www.putty.org/) SSH Client with the following settings:
79+
80+
- Host Name: `localhost`
81+
- Port: `4000`
82+
- Connection type: Telnet
83+
84+
For testing with the Task Tracker App (or any other programm which supports a serial interface),
85+
one can forward the RFC2217 TCP connection to a pseudo terminal.
86+
For example using [socat](http://www.dest-unreach.org/socat/):
87+
88+
socat -d -d pty,raw,echo=0,link=/tmp/tcp_tty tcp:localhost:4000
89+
90+
Now you can connect to the serial terminal using these settings:
91+
92+
- path to serial line: `/tmp/tcp_tty`
93+
- speed: `115200` baud
94+
- data bits: `8`
95+
- stop bits: `1`
96+
- parity: none
97+
- flow control: none
7898

7999
### Debugging
80100

doc/hardware-architecture.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Hardware Architecture {#hardware_architecture}
2+
=====================
3+
4+
The Task-Tracker-Device consists of hardware which is described in this chapter.
5+
6+
The coarse structure of the hardware is sketched in the following diagram:
7+
8+
![diagram showing the hardware structure](hardware-structure.svg)
9+
10+
- The **microcontroller** block represents the used microcomputer including its immediate external components which are necessary for general operation.
11+
This block is realized by a the development board [ESP32-S3-DevKitC-1](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html).
12+
It includes a UART to USB transciever for convenient connection to a host system.
13+
A DC voltage converter from 5V to 3.3V is also included.
14+
- The **power and battery charger** provides an integrated limited power source.
15+
It is capable to provide uninterrupted power for the other components while charging or disconnected.
16+
- A **USB** connector is used for power and data.
17+
Serial communication is transported over USB data.
18+
The microcontroller also acts as a USB mass storage device to a USB host.
19+
- A OLED **display** is connected via I2C to the microcontroller.
20+
It has 124x64 monochrome pixels.
21+
- A real-time clock (**RTC**) provides the current wall-clock time to the microcontroller.
22+
- **LEDs** and a **buzzer** are use to advertise states or events to the user.
23+
- **Buttons** can be used by the user to directly interact with the device.

doc/hardware-structure.svg

Lines changed: 3 additions & 0 deletions
Loading

lib/3rd_party_adapters/Arduino/serial_port.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ void setCallbackForLineReception(const StringHandler &callback)
4444

4545
} // namespace serial_port
4646

47-
/*
48-
SerialEvent occurs whenever a new data comes in the hardware serial RX. This
49-
routine is run between each time loop() runs, so using delay inside loop can
50-
delay response. Multiple bytes of data may be available.
51-
*/
52-
void serialEvent()
47+
void serial_port::readAndHandleInput()
5348
{
5449
while (Serial.available() > 0)
5550
{

lib/application_business_rules/serial_interface/serial_port.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void initialize();
3333
/**
3434
* Reads a line from serial port.
3535
*
36-
* Interprets the end of line as `\n`.
36+
* Expects the end of line to be `\n`.
3737
* It will wait for data for the duration of the timeout.
3838
* \returns an empty string in case no data is read
3939
*/
@@ -42,7 +42,7 @@ String readLine();
4242
/**
4343
* Gets a line from serial port.
4444
*
45-
* Interprets the end of line as `\n`.
45+
* Expects the end of line to be `\n`.
4646
* \returns an object that does not contain a value in case no data is already available.
4747
*/
4848
std::optional<String> getLine();
@@ -58,6 +58,8 @@ typedef std::function<void(const String &)> StringHandler;
5858
*/
5959
void setCallbackForLineReception(const StringHandler &callback);
6060

61+
void readAndHandleInput();
62+
6163
} // namespace serial_port
6264

6365
/**

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ void loop()
3232
static Presenter presenter(singleMenu, board::getStatusIndicators());
3333
static ProcessHmiInputs processHmiInputs(presenter, board::getKeypad());
3434

35+
serial_port::readAndHandleInput();
36+
3537
for (auto task : device::tasks)
3638
{
3739
serial_port::cout << task.second.getLabel() << " : " << std::boolalpha << task.second.isRunning()

0 commit comments

Comments
 (0)