Skip to content

Instantly share code, notes, and snippets.

@rmmh
rmmh / gist:8515577
Created January 20, 2014 05:53
MSP430 Alphanumeric Instructions
[0-9a-zA-Z]{2}
30-39,41-5a,61-7a
a:61 z:7a A:41 Z:5a 0:30 9:39
MSP430 alphanumeric shellcode is hard. There's no way to write to memory,
no word-sized reg-reg operations, and all we have is add/sub/mov and a few conditional jumps.
@hdznrrd
hdznrrd / arm_cortex_m3_mutex.c
Created November 7, 2012 14:42
basic implementation of a no-block / no-wait mutex for ARM Cortex M3 and compatible models
// this is a very basic mutex implementation
// its aim is to try to acquire access to a critical section or fail.
// there is no spinlock or event-waiting going on.
// in case it fails to acquire the lock, it simply returns false.
//
//
// relevant read:
//
// Synchronization primitives
// http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABHCIHB.html
@ianmcmahon
ianmcmahon / gist:5737796
Created June 9, 2013 05:55
CORRECTED SPI0_SPIDEV dts.
/*
* Copyright (C) 2013 Ian McMahon <imcmahon@prototechnical.com>
*
* Virtual cape enabling SPIDEV on SPI0 on connector pins P9.22 P9.21 P9.18 P9.17
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;