Browse Source

doku fixes

master
Olaf Rempel 8 years ago
parent
commit
84b160bcc7
2 changed files with 11 additions and 11 deletions
  1. +2
    -4
      Makefile
  2. +9
    -7
      main.c

+ 2
- 4
Makefile View File

@@ -47,7 +47,5 @@ bin: $(PRG).bin
$(OBJCOPY) -j .text -j .data -O binary $< $@

install: text
# uisp -dprog=stk200 --erase --upload if=$(PRG).hex --verify
# avrdude -p m16 -c butterfly -b 19200 -P /dev/ttyUSB0 -U flash:w:$(PRG).hex
# avrdude -p m16 -c dragon_isp -P usb -U flash:w:$(PRG).hex
avrdude -p m32 -c dragon_isp -P usb -U flash:w:$(PRG).hex
# avrdude -p m32 -c dragon_isp -P usb -U flash:w:$(PRG).hex
mpmboot -d /dev/ttyUSB0 -a 0x11 -w flash:$(PRG).hex

+ 9
- 7
main.c View File

@@ -31,10 +31,10 @@
*
* PA0..7 -> COL1..8
* PC0..7 -> COL9..16
* PB0 / PD7(OC2) -> ROW4 (OC2 not used)
* PB1 / PD5(OC1A) -> ROW3 (OC1A not used)
* PB2 / PD4(OC1B) -> ROW2 (OC1B not used)
* PB3(OC0) / PD6 -> ROW1 (OC0 not used)
* PB0 / PD7(OC2) -> ROW2/GREEN (OC2 not used)
* PB1 / PD5(OC1A) -> ROW1/RED (OC1A not used)
* PB2 / PD4(OC1B) -> ROW4 (OC1B not used)
* PB3(OC0) / PD6 -> ROW3/BLUE (OC0 not used)
* PD0 -> RXD
* PD1 -> TXD
* PD2 -> /RX_TX
@@ -68,9 +68,9 @@ const static uint8_t versioninfo[16] = "rgb16mpm v0.99";
#define CMD_WAIT 0x00
#define CMD_SWITCH_MODE 0x01
#define CMD_GET_VERSION 0x02
// #define CMD_GET_CHIPINFO 0x03
// #define CMD_READ_MEMORY 0x11
// #define CMD_WRITE_MEMORY 0x12
#define CMD_GET_CHIPINFO 0x03 /* bootloader / mpmboot */
#define CMD_READ_MEMORY 0x11 /* bootloader / mpmboot */
#define CMD_WRITE_MEMORY 0x12 /* bootloader / mpmboot */
#define CMD_WRITE_COLOR 0x81
#define CMD_WRITE_RAW_COLOR 0x82
#define CMD_READ_RAW_COLOR 0x83
@@ -414,9 +414,11 @@ ISR(USART_TXC_vect, ISR_NOBLOCK)
UCSRA |= (1<<MPCM);
rx_bcnt = 0xFF; // FIXME: cli?

#if !(STANDALONE)
if (tx_cmd == CMD_SWITCH_MODE) { // FIXME: check mode
wdt_enable(WDTO_15MS);
}
#endif /* !(STANDALONE) */
}

int main(void) __attribute__ ((noreturn));


Loading…
Cancel
Save