Permalink
Browse files

Audio support.

Signed-off-by: Paul Brook <paul@codesourcery.com>
  • Loading branch information...
1 parent 582a377 commit e7dcc7ce8cb0ebf02dd21317866dd06f19e0ad29 Paul Brook committed Oct 16, 2012
Showing with 26 additions and 1 deletion.
  1. +3 −0 Projects/AVRISP-MKII/Lib/ISP/ISPTarget.h
  2. +1 −1 Projects/AVRISP-MKII/makefile
  3. +22 −0 Projects/AVRISP-MKII/minimus_hack.c
@@ -71,6 +71,7 @@
extern bool HardwareSPIMode;
/* Function Prototypes: */
+ void LogByte(const uint8_t Byte);
void ISPTarget_EnableTargetISP(void);
void ISPTarget_DisableTargetISP(void);
void ISPTarget_ConfigureRescueClock(void);
@@ -93,6 +94,7 @@
*/
static inline void ISPTarget_SendByte(const uint8_t Byte)
{
+ LogByte(Byte);
if (HardwareSPIMode)
SPI_SendByte(Byte);
else
@@ -128,6 +130,7 @@
*/
static inline uint8_t ISPTarget_TransferByte(const uint8_t Byte)
{
+ LogByte(Byte);
#if !defined(INVERTED_ISP_MISO)
if (HardwareSPIMode)
return SPI_TransferByte(Byte);
@@ -26,7 +26,7 @@ CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/
LD_FLAGS =
AVRDUDE_PROGRAMMER = avr109
-AVRDUDE_PORT = /dev/ttyACM1
+AVRDUDE_PORT = /dev/ttyACM0
AVRDUDE_FLAGS =
# Default target
@@ -4,6 +4,26 @@
#include "minimus_rom.h"
+#define AUDIO_SCALE 12
+
+#define BEEP_MASK (1 << 7)
+void
+LogByte(const uint8_t Byte)
+{
+ static int count;
+
+ if (count) {
+ count--;
+
+ if (Byte & 1)
+ PORTB |= BEEP_MASK;
+ else
+ PORTB &= ~(BEEP_MASK);
+ return;
+ }
+ count = AUDIO_SCALE;
+}
+
void foo(uint16_t val)
{
int i;
@@ -154,6 +174,8 @@ program_minimus(void)
if (!done_init) {
Buttons_Init();
+ DDRB |= BEEP_MASK;
+ PORTB |= BEEP_MASK;
//Serial_Init(9600, false);
done_init = true;
}

0 comments on commit e7dcc7c

Please sign in to comment.