Commit 99c447c7 authored by Dean Camera's avatar Dean Camera
Browse files

Fixed issue in USBtoSerial demos where the USART Rx line was not having its...

Fixed issue in USBtoSerial demos where the USART Rx line was not having its pullup enabled at startup, leading to noise being received from the Rx pin when left floating.

Removed unused relative Common.h header include from the DriverStubs board stub drivers.

Fixed Benito programmer, use the correct LED functions where needed to ensure correct status display at all times.
parent 4421782b
......@@ -235,15 +235,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
while (BlockSize--)
{
if (MemoryType == 'E')
{
/* Read the next EEPROM byte into the endpoint */
WriteNextResponseByte(eeprom_read_byte((uint8_t*)(uint16_t)(CurrAddress >> 1)));
/* Increment the address counter after use */
CurrAddress += 2;
}
else
if (MemoryType == 'F')
{
/* Read the next FLASH byte from the current FLASH page */
#if (FLASHEND > 0xFFFF)
......@@ -258,6 +250,14 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
HighByte = !HighByte;
}
else
{
/* Read the next EEPROM byte into the endpoint */
WriteNextResponseByte(eeprom_read_byte((uint8_t*)(uint16_t)(CurrAddress >> 1)));
/* Increment the address counter after use */
CurrAddress += 2;
}
}
}
else
......
......@@ -110,7 +110,7 @@ void SetupHardware(void)
clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Joystick_Init();
Serial_Init(9600, false);
LEDs_Init();
USB_Init();
}
......
......@@ -48,7 +48,6 @@
#include <LUFA/Version.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Peripheral/Serial.h>
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/USB/Class/CDC.h>
......
......@@ -81,9 +81,9 @@ void SetupHardware(void)
clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Serial_Init(9600, false);
LEDs_Init();
ReconfigureUSART();
USB_Init();
USB_Init();
}
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
......
This diff is collapsed.
......@@ -46,8 +46,6 @@
#include <avr/io.h>
#include <stdbool.h>
#include "../../../Common/Common.h"
// TODO: Add any required includes here
/* Enable C linkage for C++ Compilers: */
......
......@@ -46,8 +46,6 @@
/* Includes: */
#include <avr/io.h>
#include "../../../Common/Common.h"
// TODO: Add any required includes here
/* Enable C linkage for C++ Compilers: */
......
......@@ -45,8 +45,6 @@
/* Includes: */
#include <avr/io.h>
#include "../../../Common/Common.h"
// TODO: Add any required includes here
/* Enable C linkage for C++ Compilers: */
......
......@@ -86,6 +86,7 @@
* - Fixed HID Report Descriptor Parser not correctly resetting internal states when a REPORT ID element is encountered
* - Fixed incorrect BUTTONS_BUTTON1 for the STK526 target
* - Fixed RNDIS demos freezing when more than one connection was attempted simultaneously, causing memory corruption
* - Fixed USBtoSerial demo receiving noise from the USART due to pullup not being enabled
*
*
* \section Sec_ChangeLog090605 Version 090605
......
......@@ -141,6 +141,7 @@ void SetupHardware(void)
clock_prescale_set(clock_div_1);
/* Hardware Initialization */
Serial_Init(9600, false);
LEDs_Init();
USB_Init();
......@@ -165,17 +166,17 @@ void EVENT_USB_Device_Connect(void)
void EVENT_USB_Device_Disconnect(void)
{
PingPongMSRemaining = 0;
LEDs_TurnOffLEDs(LEDMASK_BUSY);
LEDs_SetAllLEDs(LEDS_NO_LEDS);
}
/** Event handler for the library USB Configuration Changed event. */
void EVENT_USB_Device_ConfigurationChanged(void)
{
PingPongMSRemaining = 0;
LEDs_TurnOffLEDs(LEDMASK_BUSY);
LEDs_SetAllLEDs(LEDS_NO_LEDS);
if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
LEDs_TurnOnLEDs(LEDMASK_ERROR);
LEDs_SetAllLEDs(LEDMASK_ERROR);
}
/** Event handler for the library USB Unhandled Control Request event. */
......@@ -233,9 +234,9 @@ void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const C
/* Check if the DTR line has been asserted - if so, start the target AVR's reset pulse */
if (CDCInterfaceInfo->State.ControlLineStates.HostToDevice & CDC_CONTROL_LINE_OUT_DTR)
{
LEDs_TurnOnLEDs(LEDMASK_BUSY);
LEDs_SetAllLEDs(LEDMASK_BUSY);
AVR_RESET_LINE_DDR |= AVR_RESET_LINE_MASK;
ResetPulseMSRemaining = AVR_RESET_PULSE_MS;
AVR_RESET_LINE_DDR |= AVR_RESET_LINE_MASK;
ResetPulseMSRemaining = AVR_RESET_PULSE_MS;
}
}
......@@ -57,8 +57,10 @@
/** LED mask for the library LED driver, to indicate RX activity. */
#define LEDMASK_RX LEDS_LED2
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_ERROR (LEDS_LED1 | LEDS_LED2)
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2)
/* Function Prototypes: */
......
......@@ -66,7 +66,7 @@ MCU = at90usb162
# Target board (see library "Board Types" documentation, USER or blank for projects not requiring
# LUFA board drivers). If USER is selected, put custom board drivers in a directory called
# "Board" inside the application directory.
BOARD = USBKEY
BOARD = USER
# Processor frequency.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment