From f31baf18053b076585605a771730500546a06ec8 Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 19 Jun 2013 23:03:53 +0200 Subject: [PATCH] Improved error handling during code generation --- common/comm_handle.h | 2 +- common/config.h | 4 +- common/uart.h | 1 - generator.py | 8 +- msp/Makefile | 13 +- msp/main.c | 11 +- msp/uart.c | 509 +++++++++------------------------------------------ msp/uart.h | 85 --------- 8 files changed, 114 insertions(+), 519 deletions(-) rewrite msp/uart.c (99%) delete mode 100644 msp/uart.h diff --git a/common/comm_handle.h b/common/comm_handle.h index 0e0fcb8..6d50df1 100644 --- a/common/comm_handle.h +++ b/common/comm_handle.h @@ -78,7 +78,7 @@ static inline void comm_handle(uint8_t c){ state.mac_received = 0; //With a packet addressed to the discovery address a master may discover the nodes on the bus. //FIXME some doc would be nice, eh? - if((CONFIG_MAC & (0xFFFFFFFFFFFFFFFFULL>>(be16toh(args->arglen)&0x3F))) == be64toh(*((uint64_t*)ARGS_END))){ + if((CONFIG_MAC & (0xFFFFFFFFFFFFFFFFull>>(be16toh(args->arglen)&0x3F))) == be64toh(*((uint64_t*)ARGS_END))){ //Send a "I'm here!"-response. uart_putc_nonblocking(0xFF); //Set the new address diff --git a/common/config.h b/common/config.h index 7d20a51..3a5b4f1 100644 --- a/common/config.h +++ b/common/config.h @@ -1,11 +1,11 @@ /* Contrary to config.c, this code is *not* autogenerated. */ -#ifndef __TEST__ +#ifdef __AVR__ #include #else #define PROGMEM -#endif//__TEST__ +#endif//__AVR__ extern unsigned int auto_config_descriptor_length; extern const char auto_config_descriptor[]; diff --git a/common/uart.h b/common/uart.h index d497880..ad2c80b 100644 --- a/common/uart.h +++ b/common/uart.h @@ -4,7 +4,6 @@ #include void uart_init(void); -uint16_t uart_getc(void); void uart_putc(uint8_t data); void uart_putc_nonblocking(uint8_t data); diff --git a/generator.py b/generator.py index e1d5a7c..03fd803 100644 --- a/generator.py +++ b/generator.py @@ -260,11 +260,13 @@ def generate(desc, device, build_path, builddate, target = 'all', node_id=None): register_callback=register_callback, member=member, device=device) - except Exception as e: - print('-----[\x1b[91;1mException occurred while rendering a module\x1b[0m]-----') + except: + print('-----[\x1b[91;1mException occurred while rendering module {}\x1b[0m]-----'.format(mname)) + print('Current module definition:') + print(json.dumps(member, indent=4, separators=(',', ': '))) print(exceptions.text_error_template().render().strip()) print('-----[end]-----') - raise e + raise #Save some space in the build config (that later gets burned into the µC's really small flash!) if functions: diff --git a/msp/Makefile b/msp/Makefile index 3c36b4f..9074fae 100644 --- a/msp/Makefile +++ b/msp/Makefile @@ -6,8 +6,17 @@ all: main program: main mspdebug -s $(SERIAL) rf2500 "prog main" -main: ../common/main.c uart_io.c fifo.c ../common/comm.c - msp430-gcc -mmcu=$(MCU) -g0 -O3 -ffunction-sections -Wl,--gc-sections,--relax -std=gnu99 -Xprint-map -o main main.c uart_io.c fifo.c comm.c autocode.c config.c -lm +main: main.c uart.c fifo.c ../common/comm.c + ssh -o VisualHostKey=no c-leuse rm -rf /tmp/foobarmsp + ssh -o VisualHostKey=no c-leuse mkdir /tmp/foobarmsp + rsync -a ./ c-leuse:/tmp/foobarmsp + scp ../common/comm.c ../common/*.h c-leuse:/tmp/foobarmsp + ssh -o VisualHostKey=no c-leuse make -C /tmp/foobarmsp remotemain CONFIG_MAC=$(CONFIG_MAC) + scp c-leuse:/tmp/foobarmsp/main ./ + ssh -o VisualHostKey=no c-leuse rm -rf /tmp/foobarmsp + +remotemain: main.c uart.c fifo.c comm.c + msp430-gcc -mmcu=$(MCU) -g0 -O3 -ffunction-sections -Wl,--gc-sections,--relax -std=gnu99 -Xprint-map -o main main.c uart.c fifo.c comm.c autocode.c config.c -lm -DCONFIG_MAC=$(CONFIG_MAC) msp430-size main clean: diff --git a/msp/main.c b/msp/main.c index b7cf510..7b55d61 100644 --- a/msp/main.c +++ b/msp/main.c @@ -10,14 +10,15 @@ #include #include "autocode.h" #include "comm.h" +#include "uart_msp.h" int main(void){ WDTCTL = WDTPW | WDTHOLD; //Disable WDT - P1DIR = 0x41; //P1.6 (green led) and P1.0 (red LED) outputs + //P1DIR = 0x41; //P1.6 (green led) and P1.0 (red LED) outputs //oscillator control - DCOCTL |= DCO1 | DCO0; - BCSCTL1 |= RSEL3 | RSEL2 | RSEL0; + DCOCTL = CALDCO_16MHZ; + BCSCTL1 = CALBC1_16MHZ; //UART io setup (RX: P1.1, TX: P1.2) P1SEL |= 0x03; @@ -29,9 +30,7 @@ int main(void){ _BIS_SR(GIE); for(;;){ - while((v = getchar()) >= 0){ - comm_handle(v); - } + uart_loop(); loop_auto(); } } diff --git a/msp/uart.c b/msp/uart.c dissimilarity index 99% index 95d0a85..a214ba9 100644 --- a/msp/uart.c +++ b/msp/uart.c @@ -1,419 +1,90 @@ -/* -* Copyright (c) 2012, Alexander I. Mykyta -* 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. -* -* 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 OWNER 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. -*/ - -/*================================================================================================== -* File History: -* NAME DATE COMMENTS -* Alex M. 11/15/2010 born -* -*=================================================================================================*/ - -/** -* \addtogroup MOD_UART -* \{ -**/ - -/** -* \file -* \brief Code for \ref MOD_UART "UART IO" -* \author Alex Mykyta (amykyta3@gmail.com) -**/ - -#include -#include - -#include -#include "result.h" -#include "uart_io.h" -#include "uart_io_internal.h" -#include "fifo.h" - -///\cond PRIVATE -#if (UIO_USE_INTERRUPTS == 1) - char rxbuf[UIO_RXBUF_SIZE]; - FIFO_t RXFIFO; - char txbuf[UIO_TXBUF_SIZE]; - FIFO_t TXFIFO; - - uint8_t txbusy; -#endif -///\endcond - -///\addtogroup UART_FUNCTIONS -///\{ - -//================================================================================================== -// Hardware Abstraction Layer -//================================================================================================== -/** -* \brief Initializes the UART controller -* \param None -* \return Nothing -* \attention The initialization routine does \e not setup the IO ports! -**/ -void init_uart(void){ -#if defined(__MSP430_HAS_USCI__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UIO_CTL1 |= UCSWRST; // soft reset - UIO_CTL0 = 0; - UIO_CTL1 = (UIO_CLK_SRC*64)+UCSWRST; - UIO_BR0 = UIO_BR0_DEFAULT; - UIO_BR1 = UIO_BR1_DEFAULT; - UIO_MCTL = UIO_MCTL_DEFAULT; - - UIO_CTL1 &= ~UCSWRST; - -#if (UIO_USE_INTERRUPTS == 1) - fifo_init(&RXFIFO,rxbuf,UIO_RXBUF_SIZE); - fifo_init(&TXFIFO,txbuf,UIO_TXBUF_SIZE); - txbusy = 0; -#if (UIO_ISR_SPLIT == 0) - UIO_IE = UCRXIE; -#else - UIO_IE = UIO_UCARXIE; -#endif -#endif - -#elif defined(__MSP430_HAS_UCA__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #error "Hardware Abstraction for UCA not written yet!" -#endif -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Gets a character from the inuart_put stream -* \param None -* \retval uint8_t Character -**/ -uint16_t uart_getc_nonblocking(void){ -#if defined(__MSP430_HAS_USCI__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#if (UIO_USE_INTERRUPTS == 1) - uint16_t chr; - if(fifo_rdcount(&RXFIFO) == 0){ // no char received - return(0x0100); - }else{ - fifo_read(&RXFIFO,&chr,1); - return(chr); - } -#else - if((UIO_IFG & UCRXIFG) == 0){ // no char received - return(0x0100); - }else{ - return(UIO_RXBUF); - } -#endif - -#elif defined(__MSP430_HAS_UCA__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #error "Hardware Abstraction for UCA not written yet!" -#endif -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Gets a character from the inuart_put stream -* \details If a character is not immediately available, function will block until it receives one. -* \param None -* \retval uint8_t Character -**/ -uint8_t uart_getc(void){ -#if defined(__MSP430_HAS_USCI__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#if (UIO_USE_INTERRUPTS == 1) - uint8_t chr; - while(fifo_rdcount(&RXFIFO) == 0); // wait until char recieved - fifo_read(&RXFIFO,&chr,1); - return(chr); -#else - while((UIO_IFG & UCRXIFG) == 0); // wait until char recieved - return(UIO_RXBUF); -#endif - -#elif defined(__MSP430_HAS_UCA__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #error "Hardware Abstraction for UCA not written yet!" -#endif -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Returns the number of characters immediately available for inuart_put -* \param None -* \retval uint16_t Characters available -**/ -uint16_t incount(void){ -#if defined(__MSP430_HAS_USCI__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#if (UIO_USE_INTERRUPTS == 1) - return(fifo_rdcount(&RXFIFO)); -#else - if((UIO_IFG & UCRXIFG) != 0){ - return(1); - } - else{ - return(0); - } -#endif - -#elif defined(__MSP430_HAS_UCA__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #error "Hardware Abstraction for UCA not written yet!" -#endif -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Sends a character -* \param [in] c Character to be sent -* \return Nothing -**/ -void uart_putc(uint8_t c){ -#if defined(__MSP430_HAS_USCI__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#if (UIO_USE_INTERRUPTS == 1) - uint8_t chr; - while(fifo_wrcount(&TXFIFO) == 0); // wait until fifo has room for another - fifo_write(&TXFIFO,&c,1); - - if(txbusy == 0){ - txbusy = 1; - fifo_read(&TXFIFO,&chr,1); - UIO_TXBUF = chr; - #if (UIO_ISR_SPLIT == 0) - UIO_IE |= UCTXIE; - #else - UIO_IE |= UIO_UCATXIE; - #endif - - } -#else - while((UIO_IFG & UCTXIFG) == 0); // wait until txbuf is empty - UIO_TXBUF = c; -#endif - -#elif defined(__MSP430_HAS_UCA__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #error "Hardware Abstraction for UCA not written yet!" -#endif -} - -//-------------------------------------------------------------------------------------------------- - -///\cond PRIVATE -#if defined(__MSP430_HAS_USCI__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#if (UIO_USE_INTERRUPTS == 1) -#if (UIO_ISR_SPLIT == 0) -// RX/TX Interrupt Service Routine -#pragma vector=UIO_ISR_VECTOR -__interrupt void UIO_rxtxISR(void) { - - uint16_t iv = UIO_IV; - uint8_t chr; - if(iv == 0x02){ - // Data Recieved - chr = UIO_RXBUF; - fifo_write(&RXFIFO,&chr,1); - }else if(iv == 0x04){ - // Transmit Buffer Empty - if(fifo_read(&TXFIFO,&chr,1) == RES_OK){ - UIO_TXBUF = chr; - }else{ - txbusy = 0; - UIO_IE &= ~UCTXIE; // disable tx interrupt - } - } -} -#else -// RX Interrupt Service Routine -#pragma vector=UIO_RXISR_VECTOR -__interrupt void UIO_rxISR(void) { - uint8_t chr; - chr = UIO_RXBUF; - fifo_write(&RXFIFO,&chr,1); -} - -// TX Interrupt Service Routine -#pragma vector=UIO_TXISR_VECTOR -__interrupt void UIO_txISR(void) { - uint8_t chr; - if(fifo_read(&TXFIFO,&chr,1) == RES_OK){ - UIO_TXBUF = chr; - }else{ - txbusy = 0; - UIO_IE &= ~UIO_UCATXIE; // disable tx interrupt - } -} -#endif -#endif - -#elif defined(__MSP430_HAS_UCA__) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #error "Hardware Abstraction for UCA not written yet!" -#endif - -///\endcond - -//================================================================================================== -// General functions -//================================================================================================== -/** -* \brief Sends a string to the serial port -* \param [in] s Pointer to string to be sent -* \return Nothing -**/ -void uart_puts(char *s) { - while(*s) { - //if(*s == '\n') What the heck is this for? - // uart_putc('\r'); - uart_putc(*s++); - } -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Reads in a string until a newline character ( \c \n)is received -* \details If an entire is not immediately available, function will block until it receives a -* newline character. -* \param [in] line Pointer to line buffer to be used. Buffer /e MUST be large enough to receive -* the line! -* \return Pointer to the received string -**/ -char* uart_getline(char *line){ - char *ch = line; - uint8_t k; - - // until we read a newline - while ((k = uart_getc()) != '\n') { - *ch++ = k; - } - - // newline dropped and Null-terminating character added - *ch = '\0'; - - // return original pointer - return(line); -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Prints a HEX formatted string -* \param [in] value Value to be printed -* \param [in] places Number of digits to print. Use \c 0 to automatically determine how many digits. -* \return Nothing -**/ -void uart_putx(uint16_t value, uint16_t places){ - int16_t i; - uint16_t j; - uint16_t bitmask; - if(places == 0){ - // size places to fit number - bitmask = 0xF000; - places = 4; - while(((value & bitmask) == 0) && (places > 0)){ - places--; - bitmask = bitmask >> 4; - } - if(places == 0){ - places = 1; - } - } - for(i = ((places-1)<<2); i >= 0; i -= 4) { - j = (value >> i) & 0xf; - if(j < 10) - uart_putc('0' + j); - else - uart_putc('A' - 10 + j); - } -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Prints an unsigned decimal formatted string -* \param [in] value Value to be printed -* \return Nothing -**/ -void uart_putd(uint16_t value){ - uint16_t n; - uint8_t str[5]; - n = 5; - - do{ - n -=1; - str[n]=(value % 10) + '0'; - value /= 10; - } while(value != 0); - - do{ - uart_putc(str[n]); - n++; - } while(n<5); -} - -//-------------------------------------------------------------------------------------------------- -/** -* \brief Prints an unsigned decimal formatted string (32 bit version) -* \param [in] value Value to be printed -* \return Nothing -**/ -void uart_putd32(uint32_t value){ - uint16_t n; - uint8_t str[10]; - n = 10; - - do{ - n -=1; - str[n]=(value % 10) + '0'; - value /= 10; - } while(value != 0); - - do{ - uart_putc(str[n]); - n++; - } while(n<10); -} -//-------------------------------------------------------------------------------------------------- -/** -* \brief Prints a signed decimal formatted string -* \param [in] value Value to be printed -* \return Nothing -**/ -void uart_putsd(int16_t value){ - uint16_t n; - uint16_t uvalue; - uint8_t str[5]; - n = 5; - - if(value < 0){ - uart_putc('-'); - value = -value; - } - uvalue = (uint16_t) value; - - do{ - n -=1; - str[n]=(uvalue % 10) + '0'; - uvalue /= 10; - } while(uvalue != 0); - - do{ - uart_putc(str[n]); - n++; - } while(n<5); -} - -///\} - -///\} +/* + * This file is part of the MSP430 hardware UART example. + * + * Copyright (C) 2012 Stefan Wendler + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/****************************************************************************** + * Hardware UART example for MSP430. + * + * Stefan Wendler + * sw@kaltpost.de + * http://gpio.kaltpost.de + ******************************************************************************/ + +#include +#include + +#include "comm.h" +#include "comm_handle.h" +#include "uart_msp.h" + +unsigned char uart_txfifo[32]; +unsigned char *uart_txfifo_head = uart_txfifo; +unsigned char *uart_txfifo_tail = uart_txfifo; + +void uart_init(void) +{ + UCA0CTL1 |= UCSSEL_2; // SMCLK + UCA0BR0 = 138; // 16MHz 115200 + UCA0BR1 = 0; // 16MHz 115200 + UCA0BR1 = 0; // 16MHz 115200 + UCA0MCTL = UCBRS2; // Modulation UCBRSx = 1 + UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine + IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt +} + +int uart_getc() +{ + if(!(IFG2&UCA0RXIFG)) + return -1; + return UCA0RXBUF; +} + +void uart_loop(){ + if(uart_txfifo_head != uart_txfifo_tail){ + if(!uart_try_putc(*uart_txfifo_tail)){ + uart_txfifo_tail++; + if(uart_txfifo_tail > uart_txfifo+sizeof(uart_txfifo)) + uart_txfifo_tail = uart_txfifo; + } + } +} + +void uart_putc_nonblocking(unsigned char c){ + *uart_txfifo_head = c; + uart_txfifo_head++; + if(uart_txfifo_head > uart_txfifo+sizeof(uart_txfifo)) + uart_txfifo_head = uart_txfifo; +} + +unsigned char uart_try_putc(unsigned char c){ + if(!(IFG2&UCA0TXIFG)) + return 1; + UCA0TXBUF = c; // TX + return 0; +} + +void uart_putc(unsigned char c) +{ + while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready? + UCA0TXBUF = c; // TX +} + +interrupt(USCIAB0RX_VECTOR) USCI0RX_ISR(void) +{ + comm_handle(UCA0RXBUF); +} diff --git a/msp/uart.h b/msp/uart.h deleted file mode 100644 index 23eed43..0000000 --- a/msp/uart.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2012, Alexander I. Mykyta -* 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. -* -* 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 OWNER 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. -*/ - -/** -* \addtogroup MOD_UART UART IO -* \brief Provides basic text IO functions for the MSP430 UART controller -* \author Alex Mykyta (amykyta3@gmail.com) -* -* This module abstracts out the UART controller to provide basic text inuart_put and outuart_put functions. \n -* -* MSP430 Processor Families Supported: -* - MSP430x2xx -* - MSP430x5xx -* - MSP430x6xx -* -* Compilers Supported: -* - TI CCS v4 -* - MSPGCC -* -* \{ -**/ - -/** -* \file -* \brief Include file for \ref MOD_UART "UART IO" -* \author Alex Mykyta (amykyta3@gmail.com) -**/ - -#ifndef __UART_IO_H__ -#define __UART_IO_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "uart_io_config.h" - -//================================================================================================== -// Function Prototypes -//================================================================================================== -///\addtogroup UART_FUNCTIONS Functions -///\{ -void init_uart(void); - -uint16_t uart_getc_nonblocking(void); // Returns the next character recieved -uint8_t uart_getc(void); // Returns the next character recieved (Blocking function) -char* uart_getline(char *line); // Gets a string from inuart_put until it hits a '\n' (Blocking Function) -uint16_t incount(void); // Returns the number of characters immediately available for inuart_put - -void uart_putc(uint8_t c); // Sends a character to the serial port. -void uart_puts(char *s); // Sends a string -void uart_putx(uint16_t value, uint16_t places); // Sends a value formatted in Hex -void uart_putd(uint16_t value); // Sends an unsigned value formatted in decimal -void uart_putsd(int16_t value); // Sends a signed value formatted in decimal -void uart_putd32(uint32_t value); -///\} - -#ifdef __cplusplus -} -#endif - -#endif -///\} -- 2.11.4.GIT