## Tested the blue pill on 10/09/2018
## 1. install pre-requisites
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt update
sudo apt install gcc-arm-embedded
# If it reports error message of conflict to gcc-arm-none-eabi, which is likely if upgrading from 4.x to 5+, please uninstall it first with:
# "sudo apt-get remove gcc-arm-none-eabi"
sudo apt -y install lib32z1 lib32ncurses5 lib32bz2-1.0
This file contains hidden or 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
| /*---------------------------------------------------------------------*/ | |
| /* --- STC MCU Limited ------------------------------------------------*/ | |
| /* --- To be downloaded from the ISP chip (limited STC15 series), for example using the main chip -----------------*/ | |
| /* --- Mobile: (86)13922805190 ----------------------------------------*/ | |
| /* --- Fax: 86-755-82905966 -------------------------------------------*/ | |
| /* --- Tel: 86-755-82948412 -------------------------------------------*/ | |
| /* --- Web: www.STCMCU.com --------------------------------------------*/ | |
| /* If you want to use this code in the program, in the program, using the information and procedures specified macro crystal technology */ | |
| /* If you want to quote this code in the article, please indicate in the article the use of information technology and procedures Wang Jing */ | |
| /*---------------------------------------------------------------------*/ |
This is a collection of code snippets for various features on the STM8S family microcontrollers (specifically the STM8S003F3). These are written against the STM8S/A SPL headers and compiled using SDCC.
Some of this controller's functions aren't particularly intuitive to program, so I'm dumping samples for future reference here. These are based on the STM8S documentation:
This file contains hidden or 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
| ////////////////////////////////////////////////// | |
| // | |
| // EDIT: Warning, this doesn't seem to work well. | |
| // | |
| ////////////////////////////////////////////////// |
This file contains hidden or 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
| // Adapted from: https://gist.github.com/miguelmota/3ea9286bd1d3c2a985b67cac4ba2130a | |
| package rsacrypto | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/sha512" | |
| "crypto/x509" | |
| "fmt" |
This file contains hidden or 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
| ;************************************************* | |
| ;* Create and move a simple sprite x,y * | |
| ;************************************************* | |
| processor 6502 | |
| org $1000 | |
| ;helpful labels | |
| CLEAR = $E544 | |
| GETIN = $FFE4 |
This file contains hidden or 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
| $html = ""; | |
| // URL containing rss feed | |
| $url = "http://www.realbeta.net63.net/blog/rss?id=1"; | |
| $xml = simplexml_load_file($url); | |
| for($i = 0; $i < 1; $i++){ | |
| $title = $xml->channel->item[$i]->title; | |
| $link = $xml->channel->item[$i]->link; | |
| $description = $xml->channel->item[$i]->description; | |
| $pubDate = $xml->channel->item[$i]->pubDate; |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "net/mail" | |
| "net/smtp" | |
| "crypto/tls" | |
| ) |