File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,9 @@ extern "C" {
8787#define MICROBIT_HAL_ACCELEROMETER_EVT_SHAKE (11)
8888#define MICROBIT_HAL_ACCELEROMETER_EVT_2G (12)
8989
90- #define MICROBIT_HAL_MICROPHONE_LEVEL_THRESHOLD_LOW (1)
91- #define MICROBIT_HAL_MICROPHONE_LEVEL_THRESHOLD_HIGH (2)
90+ // Microphone events, passed to microbit_hal_level_detector_callback().
91+ #define MICROBIT_HAL_MICROPHONE_EVT_THRESHOLD_LOW (1)
92+ #define MICROBIT_HAL_MICROPHONE_EVT_THRESHOLD_HIGH (2)
9293
9394#define MICROBIT_HAL_LOG_TIMESTAMP_NONE (0)
9495#define MICROBIT_HAL_LOG_TIMESTAMP_MILLISECONDS (1)
Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ static uint8_t sound_event_history_array[EVENT_HISTORY_SIZE];
5050void microbit_hal_level_detector_callback (int value ) {
5151 // Work out the sound event.
5252 uint8_t ev ;
53- if (value == MICROBIT_HAL_MICROPHONE_LEVEL_THRESHOLD_LOW ) {
53+ if (value == MICROBIT_HAL_MICROPHONE_EVT_THRESHOLD_LOW ) {
5454 ev = SOUND_EVENT_QUIET ;
55- } else if (value == MICROBIT_HAL_MICROPHONE_LEVEL_THRESHOLD_HIGH ) {
55+ } else if (value == MICROBIT_HAL_MICROPHONE_EVT_THRESHOLD_HIGH ) {
5656 ev = SOUND_EVENT_LOUD ;
5757 } else {
5858 // Ignore unknown events.
You can’t perform that action at this time.
0 commit comments