forked from mfulz_github/qmk_firmware
Optimized Endpoint_Read_Word_* and Pipe_Read_Word_* macros to reduce compiled size.
Fixed Programmer's Notepad project file to reflect new location of AVRISP project.
This commit is contained in:
1 parent
17d06b8494
commit
f547eb3608
5 files changed
+35
-18
No files matched your search
+1
-1
@@ -1 +1 @@
|
|||||||
<Project name="LUFA"><Folder name="Demos"><Folder name="Device"><Folder name="ClassDriver"><Folder name="AudioInput"><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.c"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.h"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.txt"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioInput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioInput\makefile"></File></Folder><Folder name="AudioOutput"><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.txt"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioOutput\makefile"></File></Folder><Folder name="CDC"><File path="Demos\Device\ClassDriver\CDC\CDC.c"></File><File path="Demos\Device\ClassDriver\CDC\CDC.h"></File><File path="Demos\Device\ClassDriver\CDC\CDC.txt"></File><File path="Demos\Device\ClassDriver\CDC\Descriptors.c"></File><File path="Demos\Device\ClassDriver\CDC\Descriptors.h"></File><File path="Demos\Device\ClassDriver\CDC\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\CDC\LUFA CDC.inf"></File><File path="Demos\Device\ClassDriver\CDC\makefile"></File></Folder><Folder name="DualCDC"><File path="Demos\Device\ClassDriver\DualCDC\Descriptors.c"></File><File path="Demos\Device\ClassDriver\DualCDC\Descriptors.h"></File><File path="Demos\Device\ClassDriver\DualCDC\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\DualCDC\DualCDC.c"></File><File path="Demos\Device\ClassDriver\DualCDC\DualCDC.h"></File><File path="Demos\Device\ClassDriver\DualCDC\DualCDC.txt"></File><File path="Demos\Device\ClassDriver\DualCDC\LUFA DualCDC.inf"></File><File path="Demos\Device\ClassDriver\DualCDC\makefile"></File></Folder><Folder name="GenericHID"><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.c"></File><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.h"></File><File path="Demos\Device\ClassDriver\GenericHID\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.c"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.h"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.txt"></File><File path="Demos\Device\ClassDriver\GenericHID\makefile"></File></Folder><Folder name="Joystick"><File path="Demos\Device\ClassDriver\Joystick\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Joystick\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Joystick\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.c"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.h"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.txt"></File><File path="Demos\Device\ClassDriver\Joystick\makefile"></File></Folder><Folder name="Keyboard"><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.txt"></File><File path="Demos\Device\ClassDriver\Keyboard\makefile"></File></Folder><Folder name="KeyboardMouse"><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.txt"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\makefile"></File></Folder><Folder name="MassStorage"><Folder name="Lib"><File path="Demos\Device\ClassDriver\MassStorage\Lib\DataflashManager.c"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\DataflashManager.h"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\SCSI.c"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\SCSI.h"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\SCSI_Codes.h"></File></Folder><File path="Demos\Device\ClassDriver\MassStorage\Descriptors.c"></File><File path="Demos\Device\ClassDriver\MassStorage\Descriptors.h"></File><File path="Demos\Device\ClassDriver\MassStorage\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\MassStorage\makefile"></File><File path="Demos\Device\ClassDriver\MaLine truncated
|
<Project name="LUFA"><Folder name="Demos"><Folder name="Device"><Folder name="ClassDriver"><Folder name="AudioInput"><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.c"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.h"></File><File path="Demos\Device\ClassDriver\AudioInput\AudioInput.txt"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioInput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioInput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioInput\makefile"></File></Folder><Folder name="AudioOutput"><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\AudioOutput.txt"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.c"></File><File path="Demos\Device\ClassDriver\AudioOutput\Descriptors.h"></File><File path="Demos\Device\ClassDriver\AudioOutput\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\AudioOutput\makefile"></File></Folder><Folder name="CDC"><File path="Demos\Device\ClassDriver\CDC\CDC.c"></File><File path="Demos\Device\ClassDriver\CDC\CDC.h"></File><File path="Demos\Device\ClassDriver\CDC\CDC.txt"></File><File path="Demos\Device\ClassDriver\CDC\Descriptors.c"></File><File path="Demos\Device\ClassDriver\CDC\Descriptors.h"></File><File path="Demos\Device\ClassDriver\CDC\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\CDC\LUFA CDC.inf"></File><File path="Demos\Device\ClassDriver\CDC\makefile"></File></Folder><Folder name="DualCDC"><File path="Demos\Device\ClassDriver\DualCDC\Descriptors.c"></File><File path="Demos\Device\ClassDriver\DualCDC\Descriptors.h"></File><File path="Demos\Device\ClassDriver\DualCDC\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\DualCDC\DualCDC.c"></File><File path="Demos\Device\ClassDriver\DualCDC\DualCDC.h"></File><File path="Demos\Device\ClassDriver\DualCDC\DualCDC.txt"></File><File path="Demos\Device\ClassDriver\DualCDC\LUFA DualCDC.inf"></File><File path="Demos\Device\ClassDriver\DualCDC\makefile"></File></Folder><Folder name="GenericHID"><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.c"></File><File path="Demos\Device\ClassDriver\GenericHID\Descriptors.h"></File><File path="Demos\Device\ClassDriver\GenericHID\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.c"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.h"></File><File path="Demos\Device\ClassDriver\GenericHID\GenericHID.txt"></File><File path="Demos\Device\ClassDriver\GenericHID\makefile"></File></Folder><Folder name="Joystick"><File path="Demos\Device\ClassDriver\Joystick\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Joystick\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Joystick\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.c"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.h"></File><File path="Demos\Device\ClassDriver\Joystick\Joystick.txt"></File><File path="Demos\Device\ClassDriver\Joystick\makefile"></File></Folder><Folder name="Keyboard"><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Descriptors.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.c"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.h"></File><File path="Demos\Device\ClassDriver\Keyboard\Keyboard.txt"></File><File path="Demos\Device\ClassDriver\Keyboard\makefile"></File></Folder><Folder name="KeyboardMouse"><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Descriptors.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.c"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.h"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\KeyboardMouse.txt"></File><File path="Demos\Device\ClassDriver\KeyboardMouse\makefile"></File></Folder><Folder name="MassStorage"><Folder name="Lib"><File path="Demos\Device\ClassDriver\MassStorage\Lib\DataflashManager.c"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\DataflashManager.h"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\SCSI.c"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\SCSI.h"></File><File path="Demos\Device\ClassDriver\MassStorage\Lib\SCSI_Codes.h"></File></Folder><File path="Demos\Device\ClassDriver\MassStorage\Descriptors.c"></File><File path="Demos\Device\ClassDriver\MassStorage\Descriptors.h"></File><File path="Demos\Device\ClassDriver\MassStorage\Doxygen.conf"></File><File path="Demos\Device\ClassDriver\MassStorage\makefile"></File><File path="Demos\Device\ClassDriver\MaLine truncated
|
||||||
@@ -511,12 +511,16 @@
|
|||||||
static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
static inline uint16_t Endpoint_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||||
static inline uint16_t Endpoint_Read_Word_LE(void)
|
static inline uint16_t Endpoint_Read_Word_LE(void)
|
||||||
{
|
{
|
||||||
uint16_t Data;
|
union
|
||||||
|
{
|
||||||
|
uint16_t Word;
|
||||||
|
uint8_t Bytes[2];
|
||||||
|
} Data;
|
||||||
|
|
||||||
Data = UEDATX;
|
Data.Bytes[0] = UEDATX;
|
||||||
Data |= (((uint16_t)UEDATX) << 8);
|
Data.Bytes[1] = UEDATX;
|
||||||
|
|
||||||
return Data;
|
return Data.Word;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Reads two bytes from the currently selected endpoint's bank in big endian format, for OUT
|
/** Reads two bytes from the currently selected endpoint's bank in big endian format, for OUT
|
||||||
@@ -529,12 +533,16 @@
|
|||||||
static inline uint16_t Endpoint_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
static inline uint16_t Endpoint_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||||
static inline uint16_t Endpoint_Read_Word_BE(void)
|
static inline uint16_t Endpoint_Read_Word_BE(void)
|
||||||
{
|
{
|
||||||
uint16_t Data;
|
union
|
||||||
|
{
|
||||||
|
uint16_t Word;
|
||||||
|
uint8_t Bytes[2];
|
||||||
|
} Data;
|
||||||
|
|
||||||
Data = (((uint16_t)UEDATX) << 8);
|
Data.Bytes[1] = UEDATX;
|
||||||
Data |= UEDATX;
|
Data.Bytes[0] = UEDATX;
|
||||||
|
|
||||||
return Data;
|
return Data.Word;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Writes two bytes to the currently selected endpoint's bank in little endian format, for IN
|
/** Writes two bytes to the currently selected endpoint's bank in little endian format, for IN
|
||||||
|
|||||||
@@ -566,12 +566,16 @@
|
|||||||
static inline uint16_t Pipe_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
static inline uint16_t Pipe_Read_Word_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||||
static inline uint16_t Pipe_Read_Word_LE(void)
|
static inline uint16_t Pipe_Read_Word_LE(void)
|
||||||
{
|
{
|
||||||
uint16_t Data;
|
union
|
||||||
|
{
|
||||||
|
uint16_t Word;
|
||||||
|
uint8_t Bytes[2];
|
||||||
|
} Data;
|
||||||
|
|
||||||
Data = UPDATX;
|
Data.Bytes[0] = UPDATX;
|
||||||
Data |= (((uint16_t)UPDATX) << 8);
|
Data.Bytes[1] = UPDATX;
|
||||||
|
|
||||||
return Data;
|
return Data.Word;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Reads two bytes from the currently selected pipe's bank in big endian format, for OUT
|
/** Reads two bytes from the currently selected pipe's bank in big endian format, for OUT
|
||||||
@@ -584,12 +588,16 @@
|
|||||||
static inline uint16_t Pipe_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
static inline uint16_t Pipe_Read_Word_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
|
||||||
static inline uint16_t Pipe_Read_Word_BE(void)
|
static inline uint16_t Pipe_Read_Word_BE(void)
|
||||||
{
|
{
|
||||||
uint16_t Data;
|
union
|
||||||
|
{
|
||||||
|
uint16_t Word;
|
||||||
|
uint8_t Bytes[2];
|
||||||
|
} Data;
|
||||||
|
|
||||||
Data = (((uint16_t)UPDATX) << 8);
|
Data.Bytes[1] = UPDATX;
|
||||||
Data |= UPDATX;
|
Data.Bytes[0] = UPDATX;
|
||||||
|
|
||||||
return Data;
|
return Data.Word;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Writes two bytes to the currently selected pipe's bank in little endian format, for IN
|
/** Writes two bytes to the currently selected pipe's bank in little endian format, for IN
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
* - Added explicit attribute masks to the device mode demos' descriptors
|
* - Added explicit attribute masks to the device mode demos' descriptors
|
||||||
* - Added return values to the CDC and MIDI class driver transmit functions
|
* - Added return values to the CDC and MIDI class driver transmit functions
|
||||||
* - Added extra masks to the SPI driver, changed SPI_Init() so that the clock polarity and sample modes can be set
|
* - Added extra masks to the SPI driver, changed SPI_Init() so that the clock polarity and sample modes can be set
|
||||||
|
* - Optimized Endpoint_Read_Word_* and Pipe_Read_Word_* macros to reduce compiled size
|
||||||
*
|
*
|
||||||
* <b>Fixed:</b>
|
* <b>Fixed:</b>
|
||||||
* - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the
|
* - Fixed possible lockup in the CDC device class driver, when the host sends data that is a multiple of the
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ void SetupHardware(void)
|
|||||||
ADC_StartReading(VTARGET_ADC_CHANNEL | ADC_RIGHT_ADJUSTED | ADC_REFERENCE_AVCC);
|
ADC_StartReading(VTARGET_ADC_CHANNEL | ADC_RIGHT_ADJUSTED | ADC_REFERENCE_AVCC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Millisecond timer initialization for timeout checking */
|
/* Millisecond timer initialization for timeouts and delays */
|
||||||
OCR0A = ((F_CPU / 64) / 1000);
|
OCR0A = ((F_CPU / 64) / 1000);
|
||||||
TCCR0A = (1 << WGM01);
|
TCCR0A = (1 << WGM01);
|
||||||
TCCR0B = ((1 << CS01) | (1 << CS00));
|
TCCR0B = ((1 << CS01) | (1 << CS00));
|
||||||
|
|||||||
Reference in new issue
Block a user