Skip to content

Commit

Permalink
Merge branch 'noise-maker'
Browse files Browse the repository at this point in the history
  • Loading branch information
mash committed Aug 31, 2014
2 parents 7042c74 + 86df7f7 commit 0641425
Show file tree
Hide file tree
Showing 49 changed files with 114 additions and 168 deletions.
1 change: 0 additions & 1 deletion firmware/t/microphone/check_flash_size.rb

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/CRC8.c

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/CRC8.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/GSwifi.cpp

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/GSwifi.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/GSwifi_const.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/Global.cpp

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/Global.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/Keys.cpp

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/Keys.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/MemoryFree.c

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/MemoryFree.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/MorseListener.cpp

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/MorseListener.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/convert.c

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/convert.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/host.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/ipaddr.cpp

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/ipaddr.h

This file was deleted.

139 changes: 0 additions & 139 deletions firmware/t/microphone/src/microphone.ino

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/pgmStrToRAM.c

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/pgmStrToRAM.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/pins.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/ringbuffer.c

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/ringbuffer.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/timer.h

This file was deleted.

1 change: 0 additions & 1 deletion firmware/t/microphone/src/version.h

This file was deleted.

File renamed without changes.
Empty file.
File renamed without changes.
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/FullColorLed.cpp
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/FullColorLed.h
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/IrCtrl.cpp
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/IrCtrl.h
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/IrPacker.c
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/IrPacker.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ BOARD_TAG = leonardo
ARDUINO_PORT = /dev/cu.usb*
# ARDUINO_LIBS = SoftwareSerial BGLib
ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
ARDMK_DIR = ~/proj/Arduino-Makefile
USER_LIB_PATH = ${HOME}/shared/arduino/imote
ARDMK_DIR = ~/src/github.com/sudar/Arduino-Makefile
USER_LIB_PATH = ../../lib

include ~/proj/Arduino-Makefile/arduino-mk/Arduino.mk
include ~/src/github.com/sudar/Arduino-Makefile/Arduino.mk

### flymake

Expand Down
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/MemoryFree.c
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/MemoryFree.h
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/const.h
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/env.h
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/log.h
95 changes: 95 additions & 0 deletions firmware/t/noise-maker/src/noise-maker.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#include "Arduino.h"
#include "pins.h"
#include "IrCtrl.h"
#include "MemoryFree.h"
#include "pgmStrToRAM.h"
#include "FullColorLed.h"
#include "timer.h"

volatile char sharedbuffer[ SHARED_BUFFER_SIZE ];
static FullColorLed color( FULLCOLOR_LED_R, FULLCOLOR_LED_G, FULLCOLOR_LED_B );

void on_timer();
void on_ir_receive();
void on_ir_xmit();
void send();

void setup() {
Serial.begin(115200);

//--- initialize timer

timer_init( on_timer );
timer_start( TIMER_INTERVAL );

//--- initialize full color led

pinMode(FULLCOLOR_LED_R, OUTPUT);
pinMode(FULLCOLOR_LED_G, OUTPUT);
pinMode(FULLCOLOR_LED_B, OUTPUT);
color.setLedColor( 1, 0, 0, false ); // red: error

//--- initialize IR

pinMode(IR_OUT, OUTPUT);

// pull-up
pinMode(IR_IN, INPUT);
digitalWrite(IR_IN, HIGH);

IR_initialize( &on_ir_receive );
IR_state( IR_IDLE );

color.setLedColor( 1, 1, 0, true ); // yellow blink: sending
}

void loop() {
IR_loop();

if (IrCtrl.state == IR_IDLE) {
send();
}
}

void send() {
// Apple Remote Play/Pause
IR_state( IR_WRITING );
IR_put(0x46E1); IR_put(0x2325); IR_put(0x04CE); IR_put(0x044C);
IR_put(0x04CC); IR_put(0x0D0B); IR_put(0x04CF); IR_put(0x0D09);
IR_put(0x049E); IR_put(0x0D3B); IR_put(0x049E); IR_put(0x047C);
IR_put(0x04CC); IR_put(0x0D0A); IR_put(0x049E); IR_put(0x0D3A);
IR_put(0x049E); IR_put(0x0D3A); IR_put(0x04CE); IR_put(0x0D0A);
IR_put(0x049E); IR_put(0x0D3A); IR_put(0x04CD); IR_put(0x0D0C);
IR_put(0x04CD); IR_put(0x044C); IR_put(0x04CC); IR_put(0x044C);
IR_put(0x04CB); IR_put(0x044D); IR_put(0x049C); IR_put(0x047C);
IR_put(0x04CD); IR_put(0x0D19); IR_put(0x049E); IR_put(0x0D3A);
IR_put(0x04CA); IR_put(0x0451); IR_put(0x049B); IR_put(0x0D3B);
IR_put(0x049D); IR_put(0x047C); IR_put(0x049B); IR_put(0x047E);
IR_put(0x04CB); IR_put(0x044E); IR_put(0x04CB); IR_put(0x044D);
IR_put(0x04CC); IR_put(0x044C); IR_put(0x049B); IR_put(0x047E);
IR_put(0x049A); IR_put(0x047D); IR_put(0x04C9); IR_put(0x044F);
IR_put(0x049A); IR_put(0x0D3C); IR_put(0x049C); IR_put(0x0D3B);
IR_put(0x04CF); IR_put(0x0D08); IR_put(0x049D); IR_put(0x0D3B);
IR_put(0x049C); IR_put(0x0D3E); IR_put(0x049C); IR_put(0xFFFF);
IR_put(0x0000); IR_put(0x25DF); IR_put(0x46AD); IR_put(0x1188);
IR_put(0x049C);

Serial.println(P("sending"));
IR_xmit();
}

// inside ISR, be careful
void on_timer() {
color.onTimer(); // 200msec blink

IR_timer();
}

void on_ir_receive() {
Serial.println("<i");
}

void on_ir_xmit() {
Serial.println("i>");
}

1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/pgmStrToRAM.c
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/pgmStrToRAM.h
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/pins.h
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/timer.c
1 change: 1 addition & 0 deletions firmware/t/noise-maker/src/timer.h
File renamed without changes.

0 comments on commit 0641425

Please sign in to comment.