Commit graph

13 commits

Author SHA1 Message Date
Sean Cross
977ccff309 bionic: Correct \r at the end of puts()
Since puts() calls serial_putc() directly, it needs to supply its own
\r before \n.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-05 13:03:08 +08:00
Sean Cross
014b62ab26 bionic: Have putchar() put \r if \n is printed
Since putchar() is only called by printf() (as opposed to the lower-
level serial_putc()), we can have it nicely format the output by
adding \r when \n is printed.

To get the old behavior back, call serial_putc() directly.

This fixes gcc's optimization when calling:

    printf("\n")

As this will get silently turned into a call to putchar('\n')

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-05 11:31:53 +08:00
Sean Cross
7fd6d1d093 bionic: Emit \r in puts()
Since serial_putc() doesn't automatically add \r to \n, add it in puts().

Signed-off-by: Sean Cross <xobs@kosagi.com>
2015-02-04 21:14:14 +08:00
Sean Cross
9ceaffea5d bionic: Use serial functions for puts() / putchar()
gcc will automatically use these functions for certain operations.  Don't
punt and use printf(), instead call serial_putc and serial_puts.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:52:48 +08:00
Sean Cross
8fe8d061f4 bionic: Rename _memcpy() to memcpy()
We properly replicate the standard function prototype, so use the real name.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 17:13:05 +08:00
Sean Cross
0b22ad3555 bionic: Fix toupper() command
It had its logic inverted.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 16:15:35 +08:00
Sean Cross
57ee15485b bionic: Fix build with gcc
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-12-30 12:31:13 +08:00
Sean Cross
698b123bd0 bionic: Remove strtoul
We now use the one exposed in vsprintf.  This removes code duplication.

Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-28 13:12:07 +08:00
Sean Cross
b5829b9694 bionic: Add _msleep and _usleep commands
Signed-off-by: Sean Cross <xobs@kosagi.com>
2014-11-25 17:08:48 +08:00
Sean Cross
f82c53bfdc bionic: Fix strnlen to work with length of -1
This is used to mean INT_MAX.
2014-09-09 13:59:18 +08:00
Sean Cross
e858d5eeae LAst commit before a complete refactoring 2014-07-18 16:21:28 +08:00
Sean Cross
7cb334571e fernly: wip 2014-07-04 17:31:32 +08:00
Sean Cross
9470228966 fernly: More blocks discovered 2014-06-13 17:00:11 +08:00