@@ -52,13 +52,9 @@ ESOS_CHILD_TASK(barGraph_child, uint16_t u16_num2graph){ //visual display of da
52
52
}
53
53
54
54
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
-
59
55
// 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 ;
62
58
63
59
ESOS_TASK_BEGIN ();
64
60
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM (); // wait until we can grab the output stream
@@ -75,14 +71,9 @@ ESOS_CHILD_TASK(menu) {
75
71
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM (); // let everyone else know we are done with the out stream
76
72
77
73
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
79
75
ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM (); // let everyone else know we are done with the in stream
80
76
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
-
86
77
// start the second part of the menu (largely same as above)
87
78
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM ();
88
79
ESOS_TASK_WAIT_ON_SEND_STRING ("\n+===========================+\n" );
@@ -99,18 +90,9 @@ ESOS_CHILD_TASK(menu) {
99
90
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM ();
100
91
101
92
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 );
103
94
ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM ();
104
95
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
-
114
96
// assign the appropriate sensor_processing_mode based on user input
115
97
// in the order defined in esos_sensor.h
116
98
sensor_processing_mode =
0 commit comments