Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added LGT MCU cpu duty support. #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/drivertest/firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)

DEVICE = atmega8
F_CPU = 12800000 # in Hz
F_CPU = 12000000 # in Hz
FUSE_L = 0x94
FUSE_H = 0xc9
AVRDUDE = avrdude -c stk500v2 -P avrdoper -p $(DEVICE) # edit this line for your programmer
Expand Down
3 changes: 2 additions & 1 deletion examples/drivertest/firmware/usbconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ section at the end of this file).
*/

/* ---------------------------- Hardware Config ---------------------------- */

#define USB_RUNNING_ON_LGT 1
/* This is the switch of support LGT 's cpu duty or AVR 's CPU duty */
#define USB_CFG_IOPORTNAME D
/* 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.
Expand Down
3 changes: 2 additions & 1 deletion usbdrv/usbconfig-prototype.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ section at the end of this file).
*/

/* ---------------------------- Hardware Config ---------------------------- */

#define USB_RUNNING_ON_LGT 1
/* This is the switch of support LGT 's cpu duty or AVR 's CPU duty */
#define USB_CFG_IOPORTNAME D
/* 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.
Expand Down
41 changes: 26 additions & 15 deletions usbdrv/usbdrvasm.S
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,30 @@ usbMFTimeout:
# error "USB_CFG_CLOCK_KHZ is not one of the supported crc-rates!"
# endif
#else /* USB_CFG_CHECK_CRC */
# if USB_CFG_CLOCK_KHZ == 12000
# include "usbdrvasm12.inc"
# elif USB_CFG_CLOCK_KHZ == 12800
# include "usbdrvasm128.inc"
# elif USB_CFG_CLOCK_KHZ == 15000
# include "usbdrvasm15.inc"
# elif USB_CFG_CLOCK_KHZ == 16000
# include "usbdrvasm16.inc"
# elif USB_CFG_CLOCK_KHZ == 16500
# include "usbdrvasm165.inc"
# elif USB_CFG_CLOCK_KHZ == 20000
# include "usbdrvasm20.inc"
# else
# error "USB_CFG_CLOCK_KHZ is not one of the supported non-crc-rates!"
# endif
# if USB_RUNNING_ON_LGT
/* Logic Green V-USB support */
# if USB_CFG_CLOCK_KHZ == 12000
# include "usbdrvasm12-lgt.inc"
# elif USB_CFG_CLOCK_KHZ == 16000
# include "usbdrvasm16-lgt.inc"
# else
# error "USB_CFG_CLOCK_KHZ is not one of the supported non-crc-rates!"
# endif
# else
# if USB_CFG_CLOCK_KHZ == 12000
# include "usbdrvasm12.inc"
# elif USB_CFG_CLOCK_KHZ == 12800
# include "usbdrvasm128.inc"
# elif USB_CFG_CLOCK_KHZ == 15000
# include "usbdrvasm15.inc"
# elif USB_CFG_CLOCK_KHZ == 16000
# include "usbdrvasm16.inc"
# elif USB_CFG_CLOCK_KHZ == 16500
# include "usbdrvasm165.inc"
# elif USB_CFG_CLOCK_KHZ == 20000
# include "usbdrvasm20.inc"
# else
# error "USB_CFG_CLOCK_KHZ is not one of the supported non-crc-rates!"
# endif
# endif
#endif /* USB_CFG_CHECK_CRC */
Loading