summaryrefslogtreecommitdiffstats
path: root/watch-library
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-04-10 15:56:45 -0400
committerJoey Castillo <joeycastillo@utexas.edu>2022-04-10 15:56:45 -0400
commit6bdaff5d2abaeb614e98de2c9e5d0a02b439fa8f (patch)
tree40d44f526133511aec46dd83da4c66421e3d19bf /watch-library
parent35172ce11a184daf409f8d6c03c6844cc5382b71 (diff)
downloadSensor-Watch-6bdaff5d2abaeb614e98de2c9e5d0a02b439fa8f.tar.gz
Sensor-Watch-6bdaff5d2abaeb614e98de2c9e5d0a02b439fa8f.tar.bz2
Sensor-Watch-6bdaff5d2abaeb614e98de2c9e5d0a02b439fa8f.zip
remove all deprecated functions
Diffstat (limited to 'watch-library')
-rw-r--r--watch-library/hardware/watch/watch_deepsleep.c12
-rw-r--r--watch-library/hardware/watch/watch_extint.c8
-rw-r--r--watch-library/hardware/watch/watch_led.c10
-rw-r--r--watch-library/hardware/watch/watch_private.c9
-rw-r--r--watch-library/hardware/watch/watch_rtc.c37
-rw-r--r--watch-library/hardware/watch/watch_uart.c67
-rw-r--r--watch-library/shared/watch/watch_deepsleep.h5
-rw-r--r--watch-library/shared/watch/watch_extint.h5
-rw-r--r--watch-library/shared/watch/watch_led.h5
-rw-r--r--watch-library/shared/watch/watch_rtc.h19
-rw-r--r--watch-library/shared/watch/watch_uart.h19
-rw-r--r--watch-library/simulator/watch/watch_deepsleep.c12
-rw-r--r--watch-library/simulator/watch/watch_extint.c8
-rw-r--r--watch-library/simulator/watch/watch_led.c10
-rw-r--r--watch-library/simulator/watch/watch_private.c9
-rw-r--r--watch-library/simulator/watch/watch_rtc.c29
-rw-r--r--watch-library/simulator/watch/watch_uart.c11
17 files changed, 0 insertions, 275 deletions
diff --git a/watch-library/hardware/watch/watch_deepsleep.c b/watch-library/hardware/watch/watch_deepsleep.c
index b1b5b2c9..ae2ad31d 100644
--- a/watch-library/hardware/watch/watch_deepsleep.c
+++ b/watch-library/hardware/watch/watch_deepsleep.c
@@ -192,15 +192,3 @@ void watch_enter_backup_mode(void) {
// go into backup sleep mode (5). when we exit, the reset controller will take over.
sleep(5);
}
-
-// deprecated
-void watch_enter_shallow_sleep(bool display_on) {
- if (display_on) watch_enter_sleep_mode();
- else watch_enter_deep_sleep_mode();
-}
-
-// deprecated
-void watch_enter_deep_sleep(void) {
- watch_register_extwake_callback(BTN_ALARM, NULL, true);
- watch_enter_backup_mode();
-}
diff --git a/watch-library/hardware/watch/watch_extint.c b/watch-library/hardware/watch/watch_extint.c
index 5924b646..13e8eaa3 100644
--- a/watch-library/hardware/watch/watch_extint.c
+++ b/watch-library/hardware/watch/watch_extint.c
@@ -101,11 +101,3 @@ void watch_register_interrupt_callback(const uint8_t pin, ext_irq_cb_t callback,
ext_irq_register(pin, callback);
}
-
-inline void watch_register_button_callback(const uint8_t pin, ext_irq_cb_t callback) {
- watch_register_interrupt_callback(pin, callback, INTERRUPT_TRIGGER_RISING);
-}
-
-inline void watch_enable_buttons(void) {
- watch_enable_external_interrupts();
-}
diff --git a/watch-library/hardware/watch/watch_led.c b/watch-library/hardware/watch/watch_led.c
index 52174b54..5e2d8ecf 100644
--- a/watch-library/hardware/watch/watch_led.c
+++ b/watch-library/hardware/watch/watch_led.c
@@ -34,16 +34,6 @@ void watch_disable_leds(void) {
_watch_disable_tcc();
}
-void watch_enable_led(bool unused) {
- (void)unused;
- watch_enable_leds();
-}
-
-void watch_disable_led(bool unused) {
- (void)unused;
- watch_disable_leds();
-}
-
void watch_set_led_color(uint8_t red, uint8_t green) {
if (hri_tcc_get_CTRLA_reg(TCC0, TCC_CTRLA_ENABLE)) {
uint32_t period = hri_tcc_get_PER_reg(TCC0, TCC_PER_MASK);
diff --git a/watch-library/hardware/watch/watch_private.c b/watch-library/hardware/watch/watch_private.c
index 2bb3d812..e4a03926 100644
--- a/watch-library/hardware/watch/watch_private.c
+++ b/watch-library/hardware/watch/watch_private.c
@@ -260,15 +260,6 @@ int _read(void) {
return 0;
}
-// Alternate function that outputs to the debug UART. useful for debugging USB issues.
-// int _write(int file, char *ptr, int len) {
-// (void)file;
-// int pos = 0;
-// while(pos < len) watch_debug_putc(ptr[pos++]);
-
-// return 0;
-// }
-
void USB_Handler(void) {
tud_int_handler(0);
}
diff --git a/watch-library/hardware/watch/watch_rtc.c b/watch-library/hardware/watch/watch_rtc.c
index 28360523..8382e571 100644
--- a/watch-library/hardware/watch/watch_rtc.c
+++ b/watch-library/hardware/watch/watch_rtc.c
@@ -160,40 +160,3 @@ void RTC_Handler(void) {
RTC->MODE2.INTFLAG.reg = RTC_MODE2_INTFLAG_ALARM0;
}
}
-
-///////////////////////
-// Deprecated functions
-
-void watch_set_date_time(struct calendar_date_time date_time) {
- RTC_MODE2_CLOCK_Type val;
-
- val.bit.SECOND = date_time.time.sec;
- val.bit.MINUTE = date_time.time.min;
- val.bit.HOUR = date_time.time.hour;
- val.bit.DAY = date_time.date.day;
- val.bit.MONTH = date_time.date.month;
- val.bit.YEAR = (uint8_t)(date_time.date.year - WATCH_RTC_REFERENCE_YEAR);
-
- RTC->MODE2.CLOCK.reg = val.reg;
-
- _sync_rtc();
-}
-
-void watch_get_date_time(struct calendar_date_time *date_time) {
- _sync_rtc();
- RTC_MODE2_CLOCK_Type val = RTC->MODE2.CLOCK;
-
- date_time->time.sec = val.bit.SECOND;
- date_time->time.min = val.bit.MINUTE;
- date_time->time.hour = val.bit.HOUR;
- date_time->date.day = val.bit.DAY;
- date_time->date.month = val.bit.MONTH;
- date_time->date.year = val.bit.YEAR + WATCH_RTC_REFERENCE_YEAR;
-}
-
-void watch_register_tick_callback(ext_irq_cb_t callback) {
- tick_callbacks[7] = callback;
- NVIC_ClearPendingIRQ(RTC_IRQn);
- NVIC_EnableIRQ(RTC_IRQn);
- RTC->MODE2.INTENSET.reg = RTC_MODE2_INTENSET_PER7;
-}
diff --git a/watch-library/hardware/watch/watch_uart.c b/watch-library/hardware/watch/watch_uart.c
index c8e0600d..3aee7e3d 100644
--- a/watch-library/hardware/watch/watch_uart.c
+++ b/watch-library/hardware/watch/watch_uart.c
@@ -116,70 +116,3 @@ char watch_uart_getc(void) {
io_read(uart_io, &retval, 1);
return retval;
}
-
-// Begin deprecated functions
-
- /*
- * UART methods are Copyright (c) 2014-2017, Alex Taradov <alex@taradov.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "peripheral_clk_config.h"
-
-void watch_enable_debug_uart(uint32_t baud) {
- uint64_t br = (uint64_t)65536 * ((CONF_CPU_FREQUENCY * 4) - 16 * baud) / (CONF_CPU_FREQUENCY * 4);
-
- gpio_set_pin_direction(A2, GPIO_DIRECTION_OUT);
- gpio_set_pin_function(A2, PINMUX_PB02C_SERCOM3_PAD0);
-
- MCLK->APBCMASK.reg |= MCLK_APBCMASK_SERCOM3;
-
- GCLK->PCHCTRL[SERCOM3_GCLK_ID_CORE].reg = GCLK_PCHCTRL_GEN(0) | GCLK_PCHCTRL_CHEN;
- while (0 == (GCLK->PCHCTRL[SERCOM3_GCLK_ID_CORE].reg & GCLK_PCHCTRL_CHEN));
-
- SERCOM3->USART.CTRLA.reg =
- SERCOM_USART_CTRLA_DORD | SERCOM_USART_CTRLA_MODE(1/*USART_INT_CLK*/) |
- SERCOM_USART_CTRLA_RXPO(1/*PAD1*/) | SERCOM_USART_CTRLA_TXPO(0/*PAD0*/);
-
- SERCOM3->USART.CTRLB.reg = SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN |
- SERCOM_USART_CTRLB_CHSIZE(0/*8 bits*/);
-
- SERCOM3->USART.BAUD.reg = (uint16_t)br;
-
- SERCOM3->USART.CTRLA.reg |= SERCOM_USART_CTRLA_ENABLE;
-}
-
-void watch_debug_putc(char c) {
- while (!(SERCOM3->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE));
- SERCOM3->USART.DATA.reg = c;
-}
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void watch_debug_puts(char *s) {
- while (*s) watch_debug_putc(*s++);
-}
-#pragma GCC diagnostic pop
diff --git a/watch-library/shared/watch/watch_deepsleep.h b/watch-library/shared/watch/watch_deepsleep.h
index f3ba7091..75a0a3d0 100644
--- a/watch-library/shared/watch/watch_deepsleep.h
+++ b/watch-library/shared/watch/watch_deepsleep.h
@@ -151,10 +151,5 @@ void watch_enter_deep_sleep_mode(void);
*/
void watch_enter_backup_mode(void);
-__attribute__((deprecated("Use watch_enter_sleep_mode or watch_enter_deep_sleep_mode instead")))
-void watch_enter_shallow_sleep(bool display_on);
-
-__attribute__((deprecated("Use watch_enter_backup_mode instead")))
-void watch_enter_deep_sleep(void);
/// @}
#endif
diff --git a/watch-library/shared/watch/watch_extint.h b/watch-library/shared/watch/watch_extint.h
index 452461b3..84194e9a 100644
--- a/watch-library/shared/watch/watch_extint.h
+++ b/watch-library/shared/watch/watch_extint.h
@@ -76,10 +76,5 @@ void watch_disable_external_interrupts(void);
*/
void watch_register_interrupt_callback(const uint8_t pin, ext_irq_cb_t callback, watch_interrupt_trigger trigger);
-__attribute__((deprecated("Use watch_register_interrupt_callback or watch_register_extwake_callback instead")))
-void watch_register_button_callback(const uint8_t pin, ext_irq_cb_t callback);
-
-__attribute__((deprecated("Use watch_enable_external_interrupts instead")))
-void watch_enable_buttons(void);
/// @}
#endif
diff --git a/watch-library/shared/watch/watch_led.h b/watch-library/shared/watch/watch_led.h
index 9e9f5640..7e2dea2e 100644
--- a/watch-library/shared/watch/watch_led.h
+++ b/watch-library/shared/watch/watch_led.h
@@ -84,10 +84,5 @@ void watch_set_led_yellow(void);
/** @brief Turns both the red and the green LEDs off. */
void watch_set_led_off(void);
-__attribute__((deprecated("Use watch_enable_leds instead")))
-void watch_enable_led(bool unused);
-
-__attribute__((deprecated("Use watch_disable_leds instead")))
-void watch_disable_led(bool unused);
/// @}
#endif
diff --git a/watch-library/shared/watch/watch_rtc.h b/watch-library/shared/watch/watch_rtc.h
index 183e6dd0..6609e6b6 100644
--- a/watch-library/shared/watch/watch_rtc.h
+++ b/watch-library/shared/watch/watch_rtc.h
@@ -147,24 +147,5 @@ void watch_rtc_disable_matching_periodic_callbacks(uint8_t mask);
*/
void watch_rtc_disable_all_periodic_callbacks(void);
-/** @brief Sets the system date and time.
- * @param date_time A struct representing the date and time you wish to set.
- */
-__attribute__((deprecated("Use watch_rtc_set_date_time function instead")))
-void watch_set_date_time(struct calendar_date_time date_time);
-
-/** @brief Returns the system date and time in the provided struct.
- * @param date_time A pointer to a calendar_date_time struct. It will have with the correct date and time on return.
- */
-__attribute__((deprecated("Use the watch_rtc_get_date_time function instead")))
-void watch_get_date_time(struct calendar_date_time *date_time);
-
-/** @brief Registers a "tick" callback that will be called once per second.
- * @param callback The function you wish to have called when the clock ticks. If you pass in NULL, the tick
- * interrupt will still be enabled, but no callback function will be called.
- */
-__attribute__((deprecated("Use the watch_rtc_register_tick_callback function instead")))
-void watch_register_tick_callback(ext_irq_cb_t callback);
-
/// @}
#endif
diff --git a/watch-library/shared/watch/watch_uart.h b/watch-library/shared/watch/watch_uart.h
index 79fcd53a..3d7ee778 100644
--- a/watch-library/shared/watch/watch_uart.h
+++ b/watch-library/shared/watch/watch_uart.h
@@ -52,24 +52,5 @@ void watch_uart_puts(char *s);
*/
char watch_uart_getc(void);
-// Begin deprecated functions:
-
-/** @brief Initializes the debug UART.
- * @param baud The baud rate
- */
-__attribute__((deprecated("Use watch_enable_uart to enable the UART.")))
-void watch_enable_debug_uart(uint32_t baud);
-
-/** @brief Outputs a single character on the debug UART.
- * @param c The character you wish to output.
- */
-__attribute__((deprecated("Use watch_uart_puts to print to the UART, or printf to log debug messages over USB.")))
-void watch_debug_putc(char c);
-
-/** @brief Outputs a string on the debug UART.
- * @param s A null-terminated string.
- */
-__attribute__((deprecated("Use watch_uart_puts to print to the UART, or printf to log debug messages over USB.")))
-void watch_debug_puts(char *s);
/// @}
#endif
diff --git a/watch-library/simulator/watch/watch_deepsleep.c b/watch-library/simulator/watch/watch_deepsleep.c
index a12cf2a6..5add05e8 100644
--- a/watch-library/simulator/watch/watch_deepsleep.c
+++ b/watch-library/simulator/watch/watch_deepsleep.c
@@ -86,15 +86,3 @@ void watch_enter_backup_mode(void) {
// go into backup sleep mode (5). when we exit, the reset controller will take over.
// sleep(5);
}
-
-// deprecated
-void watch_enter_shallow_sleep(bool display_on) {
- if (display_on) watch_enter_sleep_mode();
- else watch_enter_deep_sleep_mode();
-}
-
-// deprecated
-void watch_enter_deep_sleep(void) {
- watch_register_extwake_callback(BTN_ALARM, NULL, true);
- watch_enter_backup_mode();
-}
diff --git a/watch-library/simulator/watch/watch_extint.c b/watch-library/simulator/watch/watch_extint.c
index 03abe42c..cbba4c3d 100644
--- a/watch-library/simulator/watch/watch_extint.c
+++ b/watch-library/simulator/watch/watch_extint.c
@@ -181,11 +181,3 @@ void watch_register_interrupt_callback(const uint8_t pin, ext_irq_cb_t callback,
external_interrupt_alarm_trigger = trigger;
}
}
-
-void watch_register_button_callback(const uint8_t pin, ext_irq_cb_t callback) {
- watch_register_interrupt_callback(pin, callback, INTERRUPT_TRIGGER_RISING);
-}
-
-void watch_enable_buttons(void) {
- watch_enable_external_interrupts();
-}
diff --git a/watch-library/simulator/watch/watch_led.c b/watch-library/simulator/watch/watch_led.c
index 173f1b08..068da8bd 100644
--- a/watch-library/simulator/watch/watch_led.c
+++ b/watch-library/simulator/watch/watch_led.c
@@ -30,16 +30,6 @@ void watch_enable_leds(void) {}
void watch_disable_leds(void) {}
-void watch_enable_led(bool unused) {
- (void)unused;
- watch_enable_leds();
-}
-
-void watch_disable_led(bool unused) {
- (void)unused;
- watch_disable_leds();
-}
-
void watch_set_led_color(uint8_t red, uint8_t green) {
EM_ASM({
document.getElementById('light').style.opacity = $1 / 255;
diff --git a/watch-library/simulator/watch/watch_private.c b/watch-library/simulator/watch/watch_private.c
index b852893b..4ddc2182 100644
--- a/watch-library/simulator/watch/watch_private.c
+++ b/watch-library/simulator/watch/watch_private.c
@@ -67,12 +67,3 @@ int _write(int file, char *ptr, int len) {
int _read(void) {
return 0;
}
-
-// Alternate function that outputs to the debug UART. useful for debugging USB issues.
-// int _write(int file, char *ptr, int len) {
-// (void)file;
-// int pos = 0;
-// while(pos < len) watch_debug_putc(ptr[pos++]);
-
-// return 0;
-// }
diff --git a/watch-library/simulator/watch/watch_rtc.c b/watch-library/simulator/watch/watch_rtc.c
index ea8659dc..107ae56c 100644
--- a/watch-library/simulator/watch/watch_rtc.c
+++ b/watch-library/simulator/watch/watch_rtc.c
@@ -197,32 +197,3 @@ void watch_rtc_disable_alarm_callback(void) {
alarm_interval_id = -1;
}
}
-
-///////////////////////
-// Deprecated functions
-
-void watch_set_date_time(struct calendar_date_time date_time) {
- watch_date_time val;
- val.unit.second = date_time.time.sec;
- val.unit.minute = date_time.time.min;
- val.unit.hour = date_time.time.hour;
- val.unit.day = date_time.date.day;
- val.unit.month = date_time.date.month;
- val.unit.year = date_time.date.year - WATCH_RTC_REFERENCE_YEAR;
- watch_rtc_set_date_time(val);
-}
-
-void watch_get_date_time(struct calendar_date_time *date_time) {
- if (date_time == NULL) return;
- watch_date_time val = watch_rtc_get_date_time();
- date_time->time.sec = val.unit.second;
- date_time->time.min = val.unit.minute;
- date_time->time.hour = val.unit.hour;
- date_time->date.day = val.unit.day;
- date_time->date.month = val.unit.month;
- date_time->date.year = val.unit.year + WATCH_RTC_REFERENCE_YEAR;
-}
-
-void watch_register_tick_callback(ext_irq_cb_t callback) {
- watch_rtc_register_tick_callback(callback);
-}
diff --git a/watch-library/simulator/watch/watch_uart.c b/watch-library/simulator/watch/watch_uart.c
index 7043383c..80c6a812 100644
--- a/watch-library/simulator/watch/watch_uart.c
+++ b/watch-library/simulator/watch/watch_uart.c
@@ -45,14 +45,3 @@ char watch_uart_getc(void) {
}
return 0;
}
-
-void watch_enable_debug_uart(uint32_t baud) {}
-
-void watch_debug_putc(char c) {}
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void watch_debug_puts(char *s) {
- while (*s) watch_debug_putc(*s++);
-}
-#pragma GCC diagnostic pop