Author Topic: Compilation error with DigiKeyboard.h  (Read 4968 times)

triggernet

  • Newbie
  • *
  • Posts: 1
Compilation error with DigiKeyboard.h
« on: August 23, 2018, 05:02:23 pm »
I'm using digispark attiny85 and tried some basic code like led blinking and it works but when using the DigiKeyboard.h I always encounter this error.

Here's the sample code https://github.com/CedArctic/DigiSpark-Scripts/blob/master/Wallpaper_Changer/Wallpaper_Changer.ino that encountered an error.

Here are the error when compiling and uploading the code.

Code: [Select]
In file included from c:\users\user\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5\avr\include\avr\io.h:99:0,

                 from C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbportability.h:121,

                 from C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S:19:

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrv.h:662:33: error: operator '*' has no left operand

 #       define USB_INTR_PENDING GIFR

                                 ^

C:\Users\User\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S:74:5: note: in expansion of macro 'USB_INTR_PENDING'

 #if USB_INTR_PENDING < 0x40 /* This is an I/O address, use in and out */

     ^

exit status 1
Error compiling for board Digispark (Default - 16.5mhz).


Some information:

Arduino 1.8.6
Windows 10 1803 (OS Build 17134.228)
Digispark attiny (plugged in USB 2.0 port)

neziiim

  • Newbie
  • *
  • Posts: 2
Re: Compilation error with DigiKeyboard.h
« Reply #1 on: September 01, 2018, 10:01:07 am »
I had the same issue, found a workaround but it seems a bit hacky.  If you go to %appdata%\LocalArduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S and replace USB_INTR_PENDING with any value above 0x40 on line 74 it seems to compile and work fine, eg.
 
Code: [Select]
#if 0x41 < 0x40 /* This is an I/O address, use in and out */
I'm using a knockoff board so that may be the issue.