Permalink
Browse files

converted leftover tabs to spaces

  • Loading branch information...
1 parent 941fc3e commit 563cec69996a7aa5ade17ca0d5259fbf22190069 @74hc595 committed Oct 22, 2010
Showing with 93 additions and 185 deletions.
  1. +27 −27 1bitsynth.c
  2. +18 −110 Makefile
  3. +48 −48 tiasnd.c
View
@@ -36,24 +36,24 @@
#define LFO_LED_PIN 3
#define PWR_LED_PIN 4
-#define MUXCTL D
-#define MUXCTL_PIN 5
-
-#define NUM_KNOBS 9
-#define NUM_ADC_SAMPLES 32
-#define NUM_ADC_CHANNELS 6
-#define MUXED_CH_LOW 3
-#define MUXED_CH_HIGH 5
-
-#define PITCH_KNOB 4
-#define LFO_FREQ_KNOB 6
-#define LFO_DEPTH_KNOB 1
-#define ENV_FREQ_KNOB 3
-#define ENV_WIDTH_KNOB 2
-#define AUDIO_WF_KNOB 7
-#define LFO_WF_KNOB 0
-#define EXT_KNOB_1 5
-#define EXT_KNOB_2 8
+#define MUXCTL D
+#define MUXCTL_PIN 5
+
+#define NUM_KNOBS 9
+#define NUM_ADC_SAMPLES 32
+#define NUM_ADC_CHANNELS 6
+#define MUXED_CH_LOW 3
+#define MUXED_CH_HIGH 5
+
+#define PITCH_KNOB 4
+#define LFO_FREQ_KNOB 6
+#define LFO_DEPTH_KNOB 1
+#define ENV_FREQ_KNOB 3
+#define ENV_WIDTH_KNOB 2
+#define AUDIO_WF_KNOB 7
+#define LFO_WF_KNOB 0
+#define EXT_KNOB_1 5
+#define EXT_KNOB_2 8
// 16-bit timer output compare values corresponding to MIDI note frequencies
// Computed for 12MHz CPU and 1/8 prescaler
@@ -244,7 +244,7 @@ ISR(TIMER1_COMPA_vect)
}
else
{
- shiftout = lfsr_rand() & 1;
+ shiftout = lfsr_rand() & 1;
}
// apply envelope
@@ -375,11 +375,11 @@ void update_synth_params()
uint8_t newlfowavenum = knobs[LFO_WF_KNOB].val >> 7;
if (newlfowavenum != lfowavenum)
{
- lfowavenum = newlfowavenum;
- ledpulse = 1;
- }
+ lfowavenum = newlfowavenum;
+ ledpulse = 1;
+ }
- // pulse the power LED to indicate waveform changes
+ // pulse the power LED to indicate waveform changes
if (ledpulse)
{
clear_bit(PORT(LEDS), PWR_LED_PIN);
@@ -403,7 +403,7 @@ int main(void)
DDR(LEDS) |= _BV(ENV_LED_PIN) | _BV(LFO_LED_PIN) | _BV(PWR_LED_PIN);
DDR(MUXCTL) |= _BV(MUXCTL_PIN);
- // turn on power LED
+ // turn on power LED
set_bit(PORT(LEDS), PWR_LED_PIN);
// set up main oscillator
@@ -429,13 +429,13 @@ int main(void)
adctimer = 0;
for (;;)
{
- uint8_t adcchan = 0;
+ uint8_t adcchan = 0;
adctimer++;
adctimer &= (NUM_ADC_SAMPLES-1);
- // select mux channel group 0
- clear_bit(PORT(MUXCTL), MUXCTL_PIN);
+ // select mux channel group 0
+ clear_bit(PORT(MUXCTL), MUXCTL_PIN);
// read ADC channels
for (adcchan = 0; adcchan < NUM_ADC_CHANNELS; adcchan++)
View
@@ -1,134 +1,42 @@
-# Name: Makefile
-# Project: hid-mouse example
-# Author: Christian Starkjohann
-# Creation Date: 2008-04-07
-# Tabsize: 4
-# Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH
-# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
-# This Revision: $Id: Makefile 692 2008-11-07 15:07:40Z cs $
-
DEVICE = atmega48
F_CPU = 12000000 # in Hz
FUSE_L = 0xdf # see below for fuse values for particular devices
FUSE_H = 0xdd
AVRDUDE = avrdude -c avrispmkII -P usb -p $(DEVICE) # edit this line for your programmer
+OUT = 1bitsynth
-#CFLAGS =
-CFLAGS = #-Wl,-u,vfprintf -lprintf_min
-CHFLAGS = -x c -DCH_COMPILE
-
-CHSRC = #alpha32.ch
-SRC = main.c
+SRC = 1bitsynth.c
+CHSRC =
COMPILE = avr-gcc -Wall -O3 -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)
OBJECTS = $(SRC:.c=.o) $(CHSRC:.ch=.o)
-##############################################################################
-# Fuse values for particular devices
-##############################################################################
-# If your device is not listed here, go to
-# http://palmavr.sourceforge.net/cgi-bin/fc.cgi
-# and choose options for external crystal clock and no clock divider
-#
-################################## ATMega8 ##################################
-# ATMega8 FUSE_L (Fuse low byte):
-# 0x9f = 1 0 0 1 1 1 1 1
-# ^ ^ \ / \--+--/
-# | | | +------- CKSEL 3..0 (external >8M crystal)
-# | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
-# | +------------------ BODEN (BrownOut Detector enabled)
-# +-------------------- BODLEVEL (2.7V)
-# ATMega8 FUSE_H (Fuse high byte):
-# 0xc9 = 1 1 0 0 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
-# ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0
-# | | | | | +-------- BOOTSZ1
-# | | | | + --------- EESAVE (don't preserve EEPROM over chip erase)
-# | | | +-------------- CKOPT (full output swing)
-# | | +---------------- SPIEN (allow serial programming)
-# | +------------------ WDTON (WDT not always on)
-# +-------------------- RSTDISBL (reset pin is enabled)
-#
-############################## ATMega48/88/168 ##############################
-# ATMega*8 FUSE_L (Fuse low byte):
-# 0x9f = 1 0 0 1 1 1 1 1
-# ^ ^ \ / \--+--/
-# | | | +------- CKSEL 3..0 (external >8M crystal)
-# | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
-# | +------------------ CKOUT (if 0: Clock output enabled)
-# +-------------------- CKDIV8 (if 0: divide by 8)
-# ATMega*8 FUSE_H (Fuse high byte):
-# 0xde = 1 1 0 1 1 1 1 0
-# ^ ^ ^ ^ ^ \-+-/
-# | | | | | +------ BODLEVEL 0..2 (110 = 1.8 V)
-# | | | | + --------- EESAVE (preserve EEPROM over chip erase)
-# | | | +-------------- WDTON (if 0: watchdog always on)
-# | | +---------------- SPIEN (allow serial programming)
-# | +------------------ DWEN (debug wire enable)
-# +-------------------- RSTDISBL (reset pin is enabled)
-#
-############################## ATTiny25/45/85 ###############################
-# ATMega*5 FUSE_L (Fuse low byte):
-# 0xef = 1 1 1 0 1 1 1 1
-# ^ ^ \+/ \--+--/
-# | | | +------- CKSEL 3..0 (clock selection -> crystal @ 12 MHz)
-# | | +--------------- SUT 1..0 (BOD enabled, fast rising power)
-# | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
-# +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
-# ATMega*5 FUSE_H (Fuse high byte):
-# 0xdd = 1 1 0 1 1 1 0 1
-# ^ ^ ^ ^ ^ \-+-/
-# | | | | | +------ BODLEVEL 2..0 (brownout trigger level -> 2.7V)
-# | | | | +---------- EESAVE (preserve EEPROM on Chip Erase -> not preserved)
-# | | | +-------------- WDTON (watchdog timer always on -> disable)
-# | | +---------------- SPIEN (enable serial programming -> enabled)
-# | +------------------ DWEN (debug wire enable)
-# +-------------------- RSTDISBL (disable external reset -> enabled)
-#
-################################ ATTiny2313 #################################
-# ATTiny2313 FUSE_L (Fuse low byte):
-# 0xef = 1 1 1 0 1 1 1 1
-# ^ ^ \+/ \--+--/
-# | | | +------- CKSEL 3..0 (clock selection -> crystal @ 12 MHz)
-# | | +--------------- SUT 1..0 (BOD enabled, fast rising power)
-# | +------------------ CKOUT (clock output on CKOUT pin -> disabled)
-# +-------------------- CKDIV8 (divide clock by 8 -> don't divide)
-# ATTiny2313 FUSE_H (Fuse high byte):
-# 0xdb = 1 1 0 1 1 0 1 1
-# ^ ^ ^ ^ \-+-/ ^
-# | | | | | +---- RSTDISBL (disable external reset -> enabled)
-# | | | | +-------- BODLEVEL 2..0 (brownout trigger level -> 2.7V)
-# | | | +-------------- WDTON (watchdog timer always on -> disable)
-# | | +---------------- SPIEN (enable serial programming -> enabled)
-# | +------------------ EESAVE (preserve EEPROM on Chip Erase -> not preserved)
-# +-------------------- DWEN (debug wire enable)
-
-
# symbolic targets:
help:
@echo "This Makefile has no default rule. Use one of the following:"
- @echo "make hex ....... to build main.hex"
+ @echo "make hex ....... to build hex file"
@echo "make program ... to flash fuses and firmware"
@echo "make fuse ...... to flash the fuses"
@echo "make flash ..... to flash the firmware (use this on metaboard)"
@echo "make clean ..... to delete objects and hex file"
-hex: main.hex
+hex: $(OUT).hex
program: flash fuse
# rule for programming fuse bits:
fuse:
@[ "$(FUSE_H)" != "" -a "$(FUSE_L)" != "" ] || \
{ echo "*** Edit Makefile and choose values for FUSE_L and FUSE_H!"; exit 1; }
- $(AVRDUDE) -U hfuse:w:0xdd:m -U lfuse:w:0xdf:m
+ $(AVRDUDE) -U hfuse:w:$(FUSE_H):m -U lfuse:w:$(FUSE_L):m
# rule for uploading firmware:
-flash: main.hex
- $(AVRDUDE) -U flash:w:main.hex:i
+flash: $(OUT).hex
+ $(AVRDUDE) -U flash:w:$(OUT).hex:i
# rule for deleting dependent files (those which can be built by Make):
clean:
- rm -f main.hex main.lst main.obj main.cof main.list main.map main.eep.hex main.elf *.o
+ rm -f $(OUT).hex $(OUT).lst $(OUT).obj $(OUT).cof $(OUT).list $(OUT).map $(OUT).eep.hex $(OUT).elf *.o
# Generic rule for compiling C files:
.c.o:
@@ -152,18 +60,18 @@ clean:
# file targets:
-main.elf: $(OBJECTS)
- $(COMPILE) -o main.elf $(OBJECTS)
+$(OUT).elf: $(OBJECTS)
+ $(COMPILE) -o $(OUT).elf $(OBJECTS)
-main.hex: main.elf
- rm -f main.hex main.eep.hex
- avr-objcopy -j .text -j .data -O ihex main.elf main.hex
- avr-size main.hex
+$(OUT).hex: $(OUT).elf
+ rm -f $(OUT).hex $(OUT).eep.hex
+ avr-objcopy -j .text -j .data -O ihex $(OUT).elf $(OUT).hex
+ avr-size $(OUT).hex
# debugging targets:
-disasm: main.elf
- avr-objdump -d main.elf
+disasm: $(OUT).elf
+ avr-objdump -d $(OUT).elf
cpp:
- $(COMPILE) -E main.c
+ $(COMPILE) -E $(SRC)
Oops, something went wrong. Retry.

0 comments on commit 563cec6

Please sign in to comment.