summaryrefslogtreecommitdiffstats
path: root/watch-library/hardware/watch/watch_uart.c
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/hardware/watch/watch_uart.c
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/hardware/watch/watch_uart.c')
-rw-r--r--watch-library/hardware/watch/watch_uart.c67
1 files changed, 0 insertions, 67 deletions
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