]> the.earth.li Git - riso-kagaku-clone.git/commitdiff
Change to target Digispark board
authorJonathan McDowell <noodles@earth.li>
Mon, 2 Jan 2017 11:10:35 +0000 (11:10 +0000)
committerJonathan McDowell <noodles@earth.li>
Mon, 2 Jan 2017 11:14:44 +0000 (11:14 +0000)
Alter settings to work with an unaltered ATTiny85 based Digispark
board.

Makefile
main.c
usbconfig.h

index be268f6cbaf94bdbdb26755383f61dd3348c5ed9..412d0900d08ab08ac5486e70e1d707c9323f6c2a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-DEVICE = attiny45
+DEVICE = attiny85
 F_CPU = 16500000
 
 CFLAGS = -Iusbdrv -I.
 F_CPU = 16500000
 
 CFLAGS = -Iusbdrv -I.
diff --git a/main.c b/main.c
index 2308d558b52999815a8eb7a42c8318331a3068db..c72bb9e097abf542d9dce18790c54205509c1e57 100644 (file)
--- a/main.c
+++ b/main.c
@@ -27,9 +27,9 @@
 #include "usbdrv.h"
 #include "libs-device/osccal.h"
 
 #include "usbdrv.h"
 #include "libs-device/osccal.h"
 
-#define RED_BIT    8 /* Bit 3 on port B */
-#define GREEN_BIT 16 /* Bit 4 on port B */
-#define BLUE_BIT  32 /* Bit 5 on port B */
+#define GREEN_BIT  1 /* Bit 0 on port B */
+#define RED_BIT    2 /* Bit 1 on port B */
+#define BLUE_BIT   4 /* Bit 2 on port B */
 #define ALL_BITS (RED_BIT | GREEN_BIT | BLUE_BIT)
 #define CMD_SET_SERIAL 0xfa
 
 #define ALL_BITS (RED_BIT | GREEN_BIT | BLUE_BIT)
 #define CMD_SET_SERIAL 0xfa
 
index 56a980e6e742e390f569dd71007f946c88f1f97c..0b106dbca48432905b99a491fe93be0b4b979b0a 100644 (file)
@@ -29,11 +29,11 @@ section at the end of this file).
 /* This is the port where the USB bus is connected. When you configure it to
  * "B", the registers PORTB, PINB and DDRB will be used.
  */
 /* This is the port where the USB bus is connected. When you configure it to
  * "B", the registers PORTB, PINB and DDRB will be used.
  */
-#define USB_CFG_DMINUS_BIT      1
+#define USB_CFG_DMINUS_BIT      3
 /* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
  * This may be any bit in the port.
  */
 /* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
  * This may be any bit in the port.
  */
-#define USB_CFG_DPLUS_BIT       2
+#define USB_CFG_DPLUS_BIT       4
 /* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
  * This may be any bit in the port. Please note that D+ must also be connected
  * to interrupt pin INT0! [You can also use other interrupts, see section
 /* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
  * This may be any bit in the port. Please note that D+ must also be connected
  * to interrupt pin INT0! [You can also use other interrupts, see section
@@ -378,13 +378,13 @@ extern void calibrateOscillator(void);
  * which is not fully supported (such as IAR C) or if you use a differnt
  * interrupt than INT0, you may have to define some of these.
  */
  * which is not fully supported (such as IAR C) or if you use a differnt
  * interrupt than INT0, you may have to define some of these.
  */
-/* #define USB_INTR_CFG            MCUCR */
-/* #define USB_INTR_CFG_SET        ((1 << ISC00) | (1 << ISC01)) */
-/* #define USB_INTR_CFG_CLR        0 */
-/* #define USB_INTR_ENABLE         GIMSK */
-/* #define USB_INTR_ENABLE_BIT     INT0 */
-/* #define USB_INTR_PENDING        GIFR */
-/* #define USB_INTR_PENDING_BIT    INTF0 */
-/* #define USB_INTR_VECTOR         INT0_vect */
+#define USB_INTR_CFG            PCMSK
+#define USB_INTR_CFG_SET        (1 << USB_CFG_DPLUS_BIT)
+#define USB_INTR_CFG_CLR        0
+#define USB_INTR_ENABLE         GIMSK
+#define USB_INTR_ENABLE_BIT     PCIE
+#define USB_INTR_PENDING        GIFR
+#define USB_INTR_PENDING_BIT    PCIF
+#define USB_INTR_VECTOR         PCINT0_vect
 
 #endif /* __usbconfig_h_included__ */
 
 #endif /* __usbconfig_h_included__ */