o add io test
This commit is contained in:
@@ -11,8 +11,8 @@ DEVICE = atmega16
|
||||
F_CPU = 16000000 # in Hz
|
||||
FUSE_L = # see below for fuse values for particular devices
|
||||
FUSE_H =
|
||||
AVRDUDE = avrdude -c stk500v2 -p $(DEVICE) -P /dev/tty.PL2303-00002006
|
||||
#AVRDUDE = avrdude -c stk500v2 -p $(DEVICE) -P /dev/tty.PL2303-00001424
|
||||
#AVRDUDE = avrdude -c stk500v2 -p $(DEVICE) -P /dev/tty.PL2303-00002006
|
||||
AVRDUDE = sudo avrdude -c stk500v2 -p $(DEVICE) -P /dev/tty.PL2303-00002126
|
||||
|
||||
CFLAGS = -Iusbdrv -I. -DDEBUG_LEVEL=0
|
||||
#-std=gnu99
|
||||
|
||||
@@ -178,11 +178,16 @@ int main(int argc, char **argv)
|
||||
for (step = 0; step < READ_BUFFER_SIZE; step += SEND_BUFFER_SIZE) {
|
||||
addr_lo = addr & 0xffff;
|
||||
addr_hi = (addr >> 16) & 0xff;
|
||||
usb_control_msg(handle,
|
||||
cnt = usb_control_msg(handle,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE |
|
||||
USB_ENDPOINT_OUT, USB_UPLOAD_ADDR, addr_hi,
|
||||
addr_lo, (char *) read_buffer + step,
|
||||
SEND_BUFFER_SIZE, 5000);
|
||||
|
||||
if (cnt < 0) {
|
||||
fprintf(stderr, "USB error: %s\n", usb_strerror());
|
||||
exit(-1);
|
||||
}
|
||||
#if 0
|
||||
dump_packet(addr, SEND_BUFFER_SIZE, read_buffer + step);
|
||||
#endif
|
||||
|
||||
@@ -179,7 +179,7 @@ uint8_t usbFunctionRead(uint8_t * data, uint8_t len)
|
||||
int main(void)
|
||||
{
|
||||
uint8_t i;
|
||||
wdt_enable(WDTO_1S);
|
||||
//wdt_enable(WDTO_1S);
|
||||
uart_init();
|
||||
stdout = &uart_stdout;
|
||||
sram_init();
|
||||
|
||||
@@ -27,6 +27,7 @@ void uart_init(void)
|
||||
* intr */
|
||||
UBRRL = (F_CPU / (8 * 115200UL)) - 1; /* 9600 Bd */
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user