Skip to content

Instantly share code, notes, and snippets.

Cheng Sun chengsun

Block or report user

Report or block chengsun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chengsun
chengsun / README
Created Dec 17, 2012
ST f3 discovery usart
View README
You need to recompile newlib with --disable-newlib-supplied-syscalls
If you get a hard fault exception when printf'ing a %d number bigger than 10, you have to re-configure and recompile both gcc and newlib with hard floats:
--with-cpu=cortex-m4
--with-float=hard
--with-fpu=fpv4-sp-d16
--with-mode=thumb
One issue is that printf ignores everything after the first newline you enter in it. so printf("a\nb\n") would only print "a\n". Also, setting the buffer mode seems to make it quite buggy.
@chengsun
chengsun / munch.dasm16
Created Apr 10, 2012
DCPU-16 munching squares
View munch.dasm16
:loop
set j, 0
:loopn
set y, 0
set i, 0x8000
:loopy
set x, 0
:loopx
xor x, y
set [i], [charoff]
You can’t perform that action at this time.