Skip to content

Commit d85d9ed

Browse files
committed
Possible removal of hang-up
1 parent 702cf3e commit d85d9ed

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

BUILD_DIR/t4_sensor2.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,9 @@ ESOS_CHILD_TASK(barGraph_child, uint16_t u16_num2graph){ //visual display of da
5252
}
5353

5454
ESOS_CHILD_TASK(menu) {
55-
56-
static char proc_mode_buffer[8]; // buffer for holding the desired processing mode
57-
static char num_samples_buffer[8]; // buffer for holding the desired number of samples
58-
5955
// neither of these will be used across yield or waits, so no need for static(-ness)
60-
char proc_mode;
61-
char num_samples;
56+
static char proc_mode;
57+
static char num_samples;
6258

6359
ESOS_TASK_BEGIN();
6460
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM(); // wait until we can grab the output stream
@@ -75,14 +71,9 @@ ESOS_CHILD_TASK(menu) {
7571
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM(); // let everyone else know we are done with the out stream
7672

7773
ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM(); // wait until we can grab the input stream
78-
ESOS_TASK_WAIT_ON_GET_STRING(proc_mode_buffer); // write the user's input to the aforementioned buffer
74+
ESOS_TASK_WAIT_ON_GET_UINT8(proc_mode); // write the user's input to the aforementioned buffer
7975
ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM(); // let everyone else know we are done with the in stream
8076

81-
// do the above process, but for output (so the user can see what they typed)
82-
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM();
83-
ESOS_TASK_WAIT_ON_SEND_STRING(proc_mode_buffer);
84-
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM();
85-
8677
// start the second part of the menu (largely same as above)
8778
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM();
8879
ESOS_TASK_WAIT_ON_SEND_STRING("\n+===========================+\n");
@@ -99,18 +90,9 @@ ESOS_CHILD_TASK(menu) {
9990
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM();
10091

10192
ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM();
102-
ESOS_TASK_WAIT_ON_GET_STRING(num_samples_buffer);
93+
ESOS_TASK_WAIT_ON_GET_UINT8(num_samples);
10394
ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM();
10495

105-
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM();
106-
ESOS_TASK_WAIT_ON_SEND_STRING(num_samples_buffer);
107-
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM();
108-
109-
// we only need the first character of each buffer, so doing this now
110-
// will save me a lot of typing
111-
proc_mode = proc_mode_buffer[0];
112-
num_samples = num_samples_buffer[0];
113-
11496
// assign the appropriate sensor_processing_mode based on user input
11597
// in the order defined in esos_sensor.h
11698
sensor_processing_mode =

0 commit comments

Comments
 (0)