Various simplifications and serial control improvements

This commit is contained in:
Mark Qvist 2014-06-19 13:11:53 +02:00
parent 9266f851c9
commit c6748c6e4a
12 changed files with 4014 additions and 3533 deletions

View file

@ -49,7 +49,7 @@
* Baudrate for the debug console.
* $WIZ$ type = "int"; min = 300
*/
#define CONFIG_KDEBUG_BAUDRATE 57600UL
#define CONFIG_KDEBUG_BAUDRATE 9600UL
/**
* Clock source for the UART module. You need to write the code to reprogram the respective clock at the required frequency in your project before calling kdbg_init().

View file

@ -214,7 +214,7 @@
* $WIZ$ type = "int"
* $WIZ$ min = 0
*/
#define CONFIG_SER_DEFBAUDRATE 0UL
#define CONFIG_SER_DEFBAUDRATE 9600UL
/// Enable strobe pin for debugging serial interrupt. $WIZ$ type = "boolean"
#define CONFIG_SER_STROBE 0

View file

@ -465,8 +465,7 @@ static uint16_t uart_period(unsigned long bps)
#ifdef _DEBUG
long skew = bps - (long)(period + 1) * (CPU_FREQ / 16);
/* 8N1 is reliable within 3% skew */
if ((unsigned long)ABS(skew) > bps / (100 / 3))
kprintf("Baudrate off by %ldbps\n", skew);
//if ((unsigned long)ABS(skew) > bps / (100 / 3)) kprintf("Baudrate off by %ldbps\n", skew);
#endif
//DB(kprintf("uart_period(bps=%lu): period=%u\n", bps, period);)