projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull out common options in the StaticAnalysisTest build test makefile into a seperate...
[pub/USBasp.git]
/
Demos
/
Device
/
LowLevel
/
MassStorage
/
MassStorage.c
diff --git
a/Demos/Device/LowLevel/MassStorage/MassStorage.c
b/Demos/Device/LowLevel/MassStorage/MassStorage.c
index
cbfef0f
..
947636c
100644
(file)
--- a/
Demos/Device/LowLevel/MassStorage/MassStorage.c
+++ b/
Demos/Device/LowLevel/MassStorage/MassStorage.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 201
1
.
+ Copyright (C) Dean Camera, 201
2
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 201
1
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 201
2
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-80,6
+80,13
@@
void SetupHardware(void)
Dataflash_Init();
USB_Init();
Dataflash_Init();
USB_Init();
+ /* Check if the Dataflash is working, abort if not */
+ if (!(DataflashManager_CheckDataflashOperation()))
+ {
+ LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+ for(;;);
+ }
+
/* Clear Dataflash sector protections, if enabled */
DataflashManager_ResetDataflashProtections();
}
/* Clear Dataflash sector protections, if enabled */
DataflashManager_ResetDataflashProtections();
}
@@
-146,7
+153,7
@@
void EVENT_USB_Device_ControlRequest(void)
Endpoint_ClearSETUP();
/* Indicate to the host the number of supported LUNs (virtual disks) on the device */
Endpoint_ClearSETUP();
/* Indicate to the host the number of supported LUNs (virtual disks) on the device */
- Endpoint_Write_
Byte
(TOTAL_LUNS - 1);
+ Endpoint_Write_
8
(TOTAL_LUNS - 1);
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
Endpoint_ClearIN();
Endpoint_ClearStatusStage();
@@
-199,8
+206,8
@@
void MassStorage_Task(void)
if (IsMassStoreReset)
{
/* Reset the data endpoint banks */
if (IsMassStoreReset)
{
/* Reset the data endpoint banks */
- Endpoint_Reset
FIFO
(MASS_STORAGE_OUT_EPNUM);
- Endpoint_Reset
FIFO
(MASS_STORAGE_IN_EPNUM);
+ Endpoint_Reset
Endpoint
(MASS_STORAGE_OUT_EPNUM);
+ Endpoint_Reset
Endpoint
(MASS_STORAGE_IN_EPNUM);
Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
Endpoint_ClearStall();
Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM);
Endpoint_ClearStall();
@@
-309,7
+316,8
@@
static void ReturnCommandStatus(void)
if (IsMassStoreReset)
return;
}
if (IsMassStoreReset)
return;
}
-
+
/* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN();
}
/* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN();
}
+