All features working

This commit is contained in:
Christoph Hagen
2023-06-01 16:18:48 +02:00
parent e1852d2989
commit a7a8367687
8 changed files with 206 additions and 153 deletions

View File

@ -5,7 +5,10 @@
constexpr uint32_t serialBaudRate = 115200;
constexpr gpio_num_t wakeupButtonPin = GPIO_NUM_13;
// The pin connected to the push button
// The button should be connected to GND
constexpr gpio_num_t wakeupButtonPin = GPIO_NUM_27;
// The time (in seconds) for which the device should stay awake after the button is pressed
// The device also stays awake as long as a bluetooth connection is active
constexpr uint32_t wakeupDurationAfterButtonPress = 30;

View File

@ -40,6 +40,10 @@ void saveTemperatureAtCurrentIndex(Temperature temp);
uint16_t getTotalNumberOfStoredBytes();
uint16_t getNumberOfMeasurements();
uint8_t getLastTemperature(uint8_t sensorIndex);
uint16_t getRecordedBytesAtOffset(uint8_t* buffer, uint16_t offset, uint16_t count);
void discardAllRecordedBytes();

View File

@ -2,8 +2,15 @@
#include <stdint.h>
// Note: Pin requires external 4.7kOhm pull-up
constexpr uint8_t TEMPERATURE_SENSOR_PIN = 23;
constexpr uint8_t TEMPERATURE_SENSOR_MAX_COUNT = 2;
// The number of bytes composing a temperature sensor address
constexpr int TEMPERATURE_SENSOR_ADDRESS_SIZE = 8;
constexpr uint8_t temperatureSensorNotAvailable = 0;
constexpr uint8_t temperatureSensorFailure = 1;
constexpr uint8_t temperatureMinimumValue = 2;
@ -31,4 +38,6 @@ struct Temperature {
void temperatureConfigure();
void temperaturePerformUpdate(Temperature* temperatures);
void temperaturePerformUpdate(Temperature* temperatures);
void copySensorAddress(uint8_t index, uint8_t* buffer);