Skip to content

Commit 12342f9

Browse files
committed
Fixed printing of SW3 menus
1 parent 5b4f7f3 commit 12342f9

File tree

2 files changed

+23
-30
lines changed

2 files changed

+23
-30
lines changed

BUILD_DIR/t4_sensor2.c

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929

3030
// defined in "esos_sensor.h"
3131
static esos_sensor_process_t sensor_processing_mode;
32+
BOOL b_keepLooping;
33+
34+
b_keepLooping = FALSE;
3235

3336
ESOS_CHILD_TASK(menu) {
3437

@@ -43,18 +46,15 @@ ESOS_CHILD_TASK(menu) {
4346
for (;;) {
4447
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM(); // wait until we can grab the output stream
4548
// print a very pretty menu
46-
ESOS_TASK_WAIT_ON_SEND_STRING(
47-
"\n"
48-
"+===========================+\n\
49-
| Select Processing mode |\n\
50-
| 1. one-shot |\n\
51-
| 2. average |\n\
52-
| 3. minimum |\n\
53-
| 4. maximum |\n\
54-
| 5. median |\n\
55-
+===========================+\n\n\
56-
>"
57-
);
49+
ESOS_TASK_WAIT_ON_SEND_STRING("\n+===========================+");
50+
ESOS_TASK_WAIT_ON_SEND_STRING("| Select Processing mode |\n");
51+
ESOS_TASK_WAIT_ON_SEND_STRING("| 1. one-shot |\n");
52+
ESOS_TASK_WAIT_ON_SEND_STRING("| 2. average |\n");
53+
ESOS_TASK_WAIT_ON_SEND_STRING("| 3. minimum |\n");
54+
ESOS_TASK_WAIT_ON_SEND_STRING("| 4. maximum |\n");
55+
ESOS_TASK_WAIT_ON_SEND_STRING("| 5. median |\n");
56+
ESOS_TASK_WAIT_ON_SEND_STRING("+===========================+\n\n");
57+
ESOS_TASK_WAIT_ON_SEND_STRING("> ");
5858
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM(); // let everyone else know we are done with the out stream
5959

6060
ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM(); // wait until we can grab the input stream
@@ -68,20 +68,17 @@ ESOS_CHILD_TASK(menu) {
6868

6969
// start the second part of the menu (largely same as above)
7070
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM();
71-
ESOS_TASK_WAIT_ON_SEND_STRING(
72-
"\n"
73-
"+===========================+\n\
74-
| Select Number of Samples |\n\
75-
| 1. two |\n\
76-
| 2. four |\n\
77-
| 3. eight |\n\
78-
| 4. sixteen |\n\
79-
| 5. thirty-two |\n\
80-
| 6. sixty-four |\n\
81-
| 7. one-shot |\n\
82-
+===========================+\n\n\
83-
>"
84-
);
71+
ESOS_TASK_WAIT_ON_SEND_STRING("\n+===========================+\n");
72+
ESOS_TASK_WAIT_ON_SEND_STRING("| Select Number of Samples |\n");
73+
ESOS_TASK_WAIT_ON_SEND_STRING("| 1. two |\n");
74+
ESOS_TASK_WAIT_ON_SEND_STRING("| 2. four |\n");
75+
ESOS_TASK_WAIT_ON_SEND_STRING("| 3. eight |\n");
76+
ESOS_TASK_WAIT_ON_SEND_STRING("| 4. sixteen |\n");
77+
ESOS_TASK_WAIT_ON_SEND_STRING("| 5. thirty-two |\n");
78+
ESOS_TASK_WAIT_ON_SEND_STRING("| 6. sixty-four |\n");
79+
ESOS_TASK_WAIT_ON_SEND_STRING("| 7. one-shot |\n");
80+
ESOS_TASK_WAIT_ON_SEND_STRING("+===========================+\n\n");
81+
ESOS_TASK_WAIT_ON_SEND_STRING("> ");
8582
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM();
8683

8784
ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM();
@@ -136,10 +133,6 @@ ESOS_CHILD_TASK(menu) {
136133
ESOS_TASK_END();
137134
}
138135

139-
140-
141-
BOOL b_keepLooping = FALSE;
142-
143136
ESOS_USER_TASK(loop) {
144137

145138
static uint16_t u16_data;

bin/AStyle.exe

-422 KB
Binary file not shown.

0 commit comments

Comments
 (0)