summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Castillo <jose.castillo@gmail.com>2021-08-31 19:39:37 -0400
committerJoey Castillo <jose.castillo@gmail.com>2021-08-31 19:39:37 -0400
commita232999e9384e2e895a74fee46d0344cf5d26b7a (patch)
treec6e238cf6436290662b00fdab58eda4270d587d0
parent637964ae4bdbd5af4647e0e53789b77d66a23993 (diff)
downloadSensor-Watch-a232999e9384e2e895a74fee46d0344cf5d26b7a.tar.gz
Sensor-Watch-a232999e9384e2e895a74fee46d0344cf5d26b7a.tar.bz2
Sensor-Watch-a232999e9384e2e895a74fee46d0344cf5d26b7a.zip
update deprecated functions in BME280 demo app
-rw-r--r--Sensor Watch BME280 Project/app.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Sensor Watch BME280 Project/app.c b/Sensor Watch BME280 Project/app.c
index 344a2e1b..e07b35f8 100644
--- a/Sensor Watch BME280 Project/app.c
+++ b/Sensor Watch BME280 Project/app.c
@@ -28,13 +28,13 @@ void app_setup() {
watch_set_date_time(date_time);
}
- watch_enable_buttons();
- watch_register_button_callback(BTN_MODE, cb_mode_pressed);
- watch_register_button_callback(BTN_LIGHT, cb_light_pressed);
- watch_register_button_callback(BTN_ALARM, cb_alarm_pressed);
+ watch_enable_external_interrupts();
+ watch_register_interrupt_callback(BTN_MODE, cb_mode_pressed, INTERRUPT_TRIGGER_RISING);
+ watch_register_interrupt_callback(BTN_LIGHT, cb_light_pressed, INTERRUPT_TRIGGER_RISING);
+ watch_register_extwake_callback(BTN_ALARM, cb_alarm_pressed, true);
watch_enable_buzzer();
- watch_enable_led(false);
+ watch_enable_leds();
// pin A0 powers the sensor on this board.
watch_enable_digital_output(A0);
@@ -228,7 +228,7 @@ void do_temp_mode() {
temperature = read_temperature(&t_fine);
humidity = read_humidity(t_fine);
if (application_state.show_humidity) {
- sprintf(buf, "TE%2d%4.1f#%c", (int)(humidity / 10), temperature), application_state.is_fahrenheit ? 'F' : 'C';
+ sprintf(buf, "TE%2d%4.1f#%c", (int)(humidity / 10), temperature, application_state.is_fahrenheit ? 'F' : 'C');
} else {
sprintf(buf, "TE %4.1f#%c", temperature, application_state.is_fahrenheit ? 'F' : 'C');
}