Skip to content

Instantly share code, notes, and snippets.

@jetpax
jetpax / private_fork.md
Created February 21, 2023 22:15 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@jetpax
jetpax / cloudSettings
Created April 3, 2019 21:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-04-03T21:22:56.565Z","extensionVersion":"v3.2.7"}
@jetpax
jetpax / millis.c
Created November 10, 2016 16:29
Safe update of volatile multi-byte variables without disabling interrupts
/*************************************************************************************************************
There is a well known problem with reading multi-byte volatile variables atomically on an 8-bit system,
ie an ISR could update the variable's bytes half way through a read, causing a corrupted value to be read.
Standard solution is to disable interrupts during reads, but this could affect critical ISR response times.
In the case of the 1ms timer interrupt, if two back to back reads produce different results, the timer
_was_ updated by the ISR and hence either read may have been corrupted.
However, in this case, a subsequent 3rd read performed within 1ms of the previous reads will not
be updated (or corrupted) by the ISR, so we can return this 3rd read instead.
*************************************************************************************************************/
@jetpax
jetpax / LEDflashFSM.c
Created November 10, 2016 14:56
Function pointer state machine
typedef void (*FSM)(void);
/*****************************************************
* FSM: test pin
* States */
void smTestPinInit(void);
void smTestPinLo(void);
void smTestPinHi(void);