Skip to content

Instantly share code, notes, and snippets.

View WoodyWoodsta's full-sized avatar
🏄‍♂️
🇿🇦🇬🇧

Sean Wood WoodyWoodsta

🏄‍♂️
🇿🇦🇬🇧
View GitHub Profile
@WoodyWoodsta
WoodyWoodsta / includeGuard.h
Last active October 27, 2015 09:23
Multiple inclusion guard tactic for C explained
/** To prevent your code having multiply included header files,
* and hence possibly multiply declared functions and variables,
* the following tactic is used in the file to be included which will
* prevent the code from being compiled more than once.
*/
// The "ifndef" combined with the matching "endif" directives serve as a pre-processor
// "if not defined" statement, where the code between these two directives will only
// Be compiled if, in this case, the symbol "NAME_OF_HEADER_FILE_H" has not been defined.
STM32F0x -> STLinkv2:
sudo openocd -f interface/stlink-v2.cfg -f target/stm32f0x_stlink.cfg
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@WoodyWoodsta
WoodyWoodsta / LEDBlinkSTM32F051C6.c
Created July 14, 2015 18:50
LED Blink example using register accessing
// Paste this at the top of your main file
#define EVER ;;
#define RCC_PERHIPHBASE 0x40021000
#define RCC_AHBENR (RCC_PERHIPHBASE + 0x14)
#define GPIOB_PERIPHBASE 0x48000400
#define GPIOB_MODER (GPIOB_PERIPHBASE + 0x00)
#define GPIO_ODR (GPIOB_PERIPHBASE + 0x14)