Created
July 20, 2020 05:13
-
-
Save andrewsclapp/5807423aec867583ce975de8ed9caa1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\res MCU: STM8S103 | |
\res export PA_ODR PA_DDR PA_CR1 | |
#require WIPE | |
#require ]B! | |
\ #require 'IDLE | |
NVM | |
: INIT | |
[ 1 PA_DDR 3 ]B! \ set up pin for OUPUT - our output pin | |
[ 1 PA_CR1 3 ]B! \ set up pin for P-P | |
; | |
: LED! ( b -- ) | |
PA_ODR 3 B! | |
; | |
VARIABLE timer | |
: tSet TIM 300 + timer ! ; | |
: tTest TIM timer @ - 0 < ; | |
: delay | |
1 LED! | |
tSet | |
begin | |
tTest | |
NOT until | |
0 LED! | |
tSet | |
begin | |
tTest | |
NOT until | |
; | |
: startup | |
INIT | |
[ ' delay ] LITERAL BG ! \ lights LED and locks up | |
\ [ ' delay ] LITERAL 'IDLE ! \ works, but sucks the console bad | |
; | |
' startup 'BOOT ! | |
RAM | |
WIPE | |
#require PERSIST | |
PERSIST | |
RESET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment