Skip to content

Instantly share code, notes, and snippets.

View ArnaudCourbiere's full-sized avatar
🕹️

Arnaud ArnaudCourbiere

🕹️
View GitHub Profile
/* Pointer magic to determine relative addresses of variables to a
struct context pointer */
#define CNT_OFFSET(varname) ((long)&((struct context *)NULL)->varname)
#define CONF_OFFSET(varname) ((long)&((struct context *)NULL)->conf.varname)
#define TRACK_OFFSET(varname) ((long)&((struct context *)NULL)->track.varname)
#include <msp430.h>
#include <legacymsp430.h>
#define LED0 BIT0
#define LED1 BIT6
#define LED_DIR P1DIR
#define LED_OUT P1OUT
#define BUTTON BIT3
volatile unsigned int blink = 1;