]> git.earman.xyz Git - sensor-watch.git/commitdiff
remove all deprecated functions
authorJoey Castillo <joeycastillo@utexas.edu>
Sun, 10 Apr 2022 19:56:45 +0000 (15:56 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Sun, 10 Apr 2022 19:56:45 +0000 (15:56 -0400)
17 files changed:
watch-library/hardware/watch/watch_deepsleep.c
watch-library/hardware/watch/watch_extint.c
watch-library/hardware/watch/watch_led.c
watch-library/hardware/watch/watch_private.c
watch-library/hardware/watch/watch_rtc.c
watch-library/hardware/watch/watch_uart.c
watch-library/shared/watch/watch_deepsleep.h
watch-library/shared/watch/watch_extint.h
watch-library/shared/watch/watch_led.h
watch-library/shared/watch/watch_rtc.h
watch-library/shared/watch/watch_uart.h
watch-library/simulator/watch/watch_deepsleep.c
watch-library/simulator/watch/watch_extint.c
watch-library/simulator/watch/watch_led.c
watch-library/simulator/watch/watch_private.c
watch-library/simulator/watch/watch_rtc.c
watch-library/simulator/watch/watch_uart.c

index b1b5b2c9f44792adf14249cc25eab6310fa0ae22..ae2ad31d9d4f6619ee39fe6486199d33c3ca2853 100644 (file)
@@ -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();
-}
index 5924b646090185a0bc730f80ebceadb0a5a23103..13e8eaa3b7f3198555228f5a3bcc8ad0ecc75a43 100644 (file)
@@ -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();
-}
index 52174b5424e88169c9be7c31dbcd6ac250763551..5e2d8ecf3a3f39b4be23a30ec71a1101c2d14a08 100644 (file)
@@ -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);
index 2bb3d812459fd254ca5a611ceaaa0972ac20a4ee..e4a03926a2f1019cdbadaaf9dcc57e337e639049 100644 (file)
@@ -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);
 }
index 283605236d53714db12ab571f01bd9c4f52f09d9..8382e5714b142d772e1617f03dbff85854a2ff2e 100644 (file)
@@ -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;
-}
index c8e0600d015ff72e567503f56ebc81d2e4aff4be..3aee7e3dcc9fc45aca121e24d04a63d106b2968c 100644 (file)
@@ -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
index f3ba70918cbaca3bef7acf2f377ab179273e133d..75a0a3d0bb2615ea6f9ae2e501fb5f0ee2a9a2be 100644 (file)
@@ -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
index 452461b3dae07f06932b80d27174f579fff213ce..84194e9a68270e7290d4fc45bb0e8d4cf215621d 100644 (file)
@@ -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
index 9e9f56406e5319faa984603f358fff70ccb958a9..7e2dea2e93eaff6e705c6b5cfb24db4a67844746 100644 (file)
@@ -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
index 183e6dd04e4483f03e1e9bc225390643eaef7509..6609e6b66731f241ea665a8d13a86a036a0d7344 100644 (file)
@@ -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
index 79fcd53ae8ccd1fcd119117af2b6c9e79b3da5c5..3d7ee7783c80c25a9739fb6535cef7dc16201e5d 100644 (file)
@@ -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
index a12cf2a69bcb18f4acc518dc1ca3d443d77739ba..5add05e80c50486be143809f686f5e82804356e1 100644 (file)
@@ -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();
-}
index 03abe42cb980738fec9fcbf178f4e5b38ec0b4a0..cbba4c3d10ef02ab9579e87dc88712cabbf164c5 100644 (file)
@@ -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();
-}
index 173f1b085ceaf975e83df483b646a617432c72f3..068da8bd305c9d9c72b06e2984e8a0b1e897d1c9 100644 (file)
@@ -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;
index b852893bee4310dcef3f8af71a07661dc8d79f14..4ddc21828329a728cf83fe0c2a27d527a000bc69 100644 (file)
@@ -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;
-// }
index ea8659dcbd44fd63ab0cbbe863ddbd62b813d5fa..107ae56ceab91a34ac3562f4b6af2e32265ff90f 100644 (file)
@@ -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);
-}
index 7043383c71f53294804853d4a9338b8129256d24..80c6a812e96451f9df8a5069a11f0147caadb7aa 100644 (file)
@@ -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