Skip to content

Instantly share code, notes, and snippets.

class TestModule : public MessageListener
{
private:
// Instance variables which are modified by message handlers must be explicityly marked as mutable, since message handlers are const functions - this makes it obvious what is accessed.
mutable int value;
mutable const Mailbox& mailbox;
StateMachineMessageFunctor stateMachine;
// Message handlers
static void testHandler (const Message* const message, const Conversation con)
@dublindan
dublindan / gist:671226
Created November 10, 2010 18:00
Clojure Games Test Gist
(defn clojure-games
"Test Gist for http://clojure-games.org"
[]
(println "Hello from clojure-games.org"))
/**
* Flags to control how message handlers may be invoked.
* Message handlers can be invoked in a number of ways, depending on the threading model and thread safety of the handler.
*/
enum HandlerFlags
{
/* Threading Model Flags *******************/
USER_MASK = 0x000f, // ..000000001111
@dublindan
dublindan / disable_analogs
Created April 5, 2011 00:57
reading digital input pins
.include "p24Hxxxx.inc"
.text
.global __reset
__reset:
; Turn of analog to digital converter for all pins
mov #0xffff, W0
mov W0, AD1PCFGL
; Set RA0 through RA3 as inputs (1), the rest as outputs (0) (easy way to remember: 1 looks like I for In, 0 looks like O for Out)
mov #0xf, W0