update
This commit is contained in:
7
button.c
7
button.c
@@ -25,6 +25,13 @@ bool button_is_pressed(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool button_was_pressed(void) {
|
||||
if (button.push_counter > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t button_get(void) {
|
||||
if (button.strokes_ended) {
|
||||
uint8_t counter = button.push_counter;
|
||||
|
||||
1
button.h
1
button.h
@@ -19,6 +19,7 @@ extern button_t button;
|
||||
void button_init(void);
|
||||
void button_reset(void);
|
||||
bool button_is_pressed(void);
|
||||
bool button_was_pressed(void);
|
||||
void button_handle(void);
|
||||
uint8_t button_get(void);
|
||||
|
||||
|
||||
15
contr.c
15
contr.c
@@ -376,17 +376,18 @@ void contr_show_ptt(void) {
|
||||
|
||||
void contr_show_button(void) {
|
||||
if (button_is_pressed()) {
|
||||
disp_string(3, 3, "BT");
|
||||
disp_string(3, 6, "*");
|
||||
} else {
|
||||
disp_string(3, 3, " ");
|
||||
disp_string(3, 6, " ");
|
||||
}
|
||||
if (button_was_pressed()) {
|
||||
sprintf(contr.disp_str, "%u", button.push_counter);
|
||||
disp_string(3, 7, contr.disp_str);
|
||||
} else {
|
||||
disp_string(3, 7, " ");
|
||||
}
|
||||
//if (button.strokes_ended) {
|
||||
sprintf(contr.disp_str, "%1u", button.push_counter);
|
||||
disp_string(3, 5, contr.disp_str);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
void contr_show_freq(void) {
|
||||
uint16_t freq = contr_get_freq();
|
||||
sprintf(contr.disp_str, "%2uM", freq);
|
||||
|
||||
Reference in New Issue
Block a user