Merge branch 'main' of github.com:joeycastillo/Sensor-Watch into mars-clock
This commit is contained in:
@@ -52,6 +52,7 @@ void watch_display_character(uint8_t character, uint8_t position) {
|
||||
if (character == 'T') character = 't'; // uppercase T only works in positions 0 and 1
|
||||
}
|
||||
if (position == 1) {
|
||||
if (character == 'a') character = 'A'; // A needs to be uppercase
|
||||
if (character == 'o') character = 'O'; // O needs to be uppercase
|
||||
if (character == 'i') character = 'l'; // I needs to be uppercase (use an l, it looks the same)
|
||||
if (character == 'n') character = 'N'; // N needs to be uppercase
|
||||
|
||||
@@ -188,3 +188,11 @@ float watch_utility_thermistor_temperature(uint16_t value, bool highside, float
|
||||
|
||||
return reading;
|
||||
}
|
||||
|
||||
uint32_t watch_utility_offset_timestamp(uint32_t now, int8_t hours, int8_t minutes, int8_t seconds) {
|
||||
uint32_t new = now;
|
||||
new += hours * 60 * 60;
|
||||
new += minutes * 60;
|
||||
new += seconds;
|
||||
return new;
|
||||
}
|
||||
|
||||
@@ -124,4 +124,12 @@ watch_date_time watch_utility_date_time_convert_zone(watch_date_time date_time,
|
||||
*/
|
||||
float watch_utility_thermistor_temperature(uint16_t value, bool highside, float b_coefficient, float nominal_temperature, float nominal_resistance, float series_resistance);
|
||||
|
||||
/** @brief Offset a timestamp by a given amount
|
||||
* @param now Timestamp to offset from
|
||||
* @param hours Number of hours to offset
|
||||
* @param minutes Nmber of minutes to offset
|
||||
* @param seconds Number of secodns to offset
|
||||
*/
|
||||
uint32_t watch_utility_offset_timestamp(uint32_t now, int8_t hours, int8_t minutes, int8_t seconds);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,7 +29,7 @@ void watch_enable_adc(void) {}
|
||||
void watch_enable_analog_input(const uint8_t pin) {}
|
||||
|
||||
uint16_t watch_get_analog_pin_level(const uint8_t pin) {
|
||||
return 0;
|
||||
return 32767; // pretend it's half of VCC
|
||||
}
|
||||
|
||||
void watch_set_analog_num_samples(uint16_t samples) {}
|
||||
|
||||
Reference in New Issue
Block a user