Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
fc8e4837
Commit
fc8e4837
authored
Apr 18, 2010
by
Dean Camera
Browse files
Add const keyword to the demo function parameters where possible.
parent
55db57e1
Changes
47
Expand all
Hide whitespace changes
Inline
Side-by-side
Demos/Host/LowLevel/PrinterHost/Lib/PrinterCommands.h
View file @
fc8e4837
...
...
@@ -59,8 +59,8 @@
#define PRINTER_DATA_OUT_PIPE 2
/* Function Prototypes: */
uint8_t
Printer_SendData
(
void
*
PrinterCommands
,
uint16_t
CommandSize
);
uint8_t
Printer_GetDeviceID
(
char
*
DeviceIDString
,
uint16_t
BufferSize
);
uint8_t
Printer_SendData
(
const
void
*
const
PrinterCommands
,
const
uint16_t
CommandSize
);
uint8_t
Printer_GetDeviceID
(
char
*
DeviceIDString
,
const
uint16_t
BufferSize
);
uint8_t
Printer_GetPortStatus
(
uint8_t
*
PortStatus
);
uint8_t
Printer_SoftReset
(
void
);
...
...
Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.c
View file @
fc8e4837
...
...
@@ -47,7 +47,7 @@ uint32_t RequestID = 0;
*
* \return A value from the USB_Host_SendControlErrorCodes_t enum
*/
uint8_t
RNDIS_SendEncapsulatedCommand
(
void
*
Buffer
,
uint16_t
Length
)
uint8_t
RNDIS_SendEncapsulatedCommand
(
void
*
const
Buffer
,
const
uint16_t
Length
)
{
USB_ControlRequest
=
(
USB_Request_Header_t
)
{
...
...
@@ -71,7 +71,7 @@ uint8_t RNDIS_SendEncapsulatedCommand(void* Buffer, uint16_t Length)
*
* \return A value from the USB_Host_SendControlErrorCodes_t enum
*/
uint8_t
RNDIS_GetEncapsulatedResponse
(
void
*
Buffer
,
uint16_t
Length
)
uint8_t
RNDIS_GetEncapsulatedResponse
(
void
*
const
Buffer
,
const
uint16_t
Length
)
{
USB_ControlRequest
=
(
USB_Request_Header_t
)
{
...
...
@@ -128,7 +128,7 @@ uint8_t RNDIS_SendKeepAlive(void)
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
* logical command failure
*/
uint8_t
RNDIS_InitializeDevice
(
uint16_t
HostMaxPacketSize
,
uint16_t
*
DeviceMaxPacketSize
)
uint8_t
RNDIS_InitializeDevice
(
const
uint16_t
HostMaxPacketSize
,
uint16_t
*
const
DeviceMaxPacketSize
)
{
uint8_t
ErrorCode
;
...
...
@@ -172,7 +172,7 @@ uint8_t RNDIS_InitializeDevice(uint16_t HostMaxPacketSize, uint16_t* DeviceMaxPa
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
* logical command failure
*/
uint8_t
RNDIS_SetRNDISProperty
(
uint32_t
Oid
,
void
*
Buffer
,
uint16_t
Length
)
uint8_t
RNDIS_SetRNDISProperty
(
const
uint32_t
Oid
,
void
*
Buffer
,
const
uint16_t
Length
)
{
uint8_t
ErrorCode
;
...
...
@@ -222,7 +222,7 @@ uint8_t RNDIS_SetRNDISProperty(uint32_t Oid, void* Buffer, uint16_t Length)
* \return A value from the USB_Host_SendControlErrorCodes_t enum or RNDIS_COMMAND_FAILED if the device returned a
* logical command failure
*/
uint8_t
RNDIS_QueryRNDISProperty
(
uint32_t
Oid
,
void
*
Buffer
,
uint16_t
MaxLength
)
uint8_t
RNDIS_QueryRNDISProperty
(
const
uint32_t
Oid
,
void
*
Buffer
,
const
uint16_t
MaxLength
)
{
uint8_t
ErrorCode
;
...
...
@@ -270,7 +270,7 @@ uint8_t RNDIS_QueryRNDISProperty(uint32_t Oid, void* Buffer, uint16_t MaxLength)
*
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
*/
uint8_t
RNDIS_GetPacketLength
(
uint16_t
*
PacketLength
)
uint8_t
RNDIS_GetPacketLength
(
uint16_t
*
const
PacketLength
)
{
uint8_t
ErrorCode
;
...
...
Demos/Host/LowLevel/RNDISEthernetHost/Lib/RNDISCommands.h
View file @
fc8e4837
...
...
@@ -200,13 +200,13 @@
#define RNDIS_COMMAND_FAILED 0xC0
/* Function Prototypes: */
uint8_t
RNDIS_SendEncapsulatedCommand
(
void
*
Buffer
,
uint16_t
Length
);
uint8_t
RNDIS_GetEncapsulatedResponse
(
void
*
Buffer
,
uint16_t
Length
);
uint8_t
RNDIS_SendEncapsulatedCommand
(
void
*
const
Buffer
,
const
uint16_t
Length
);
uint8_t
RNDIS_GetEncapsulatedResponse
(
void
*
const
Buffer
,
const
uint16_t
Length
);
uint8_t
RNDIS_SendKeepAlive
(
void
);
uint8_t
RNDIS_InitializeDevice
(
uint16_t
HostMaxPacketSize
,
uint16_t
*
DeviceMaxPacketSize
);
uint8_t
RNDIS_SetRNDISProperty
(
uint32_t
Oid
,
void
*
Buffer
,
uint16_t
Length
);
uint8_t
RNDIS_QueryRNDISProperty
(
uint32_t
Oid
,
void
*
Buffer
,
uint16_t
MaxLength
);
uint8_t
RNDIS_GetPacketLength
(
uint16_t
*
PacketLength
);
uint8_t
RNDIS_InitializeDevice
(
const
uint16_t
HostMaxPacketSize
,
uint16_t
*
const
DeviceMaxPacketSize
);
uint8_t
RNDIS_SetRNDISProperty
(
const
uint32_t
Oid
,
void
*
Buffer
,
const
uint16_t
Length
);
uint8_t
RNDIS_QueryRNDISProperty
(
const
uint32_t
Oid
,
void
*
Buffer
,
const
uint16_t
MaxLength
);
uint8_t
RNDIS_GetPacketLength
(
uint16_t
*
const
PacketLength
);
#endif
Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
View file @
fc8e4837
...
...
@@ -198,7 +198,7 @@ uint8_t SImage_ReceiveBlockHeader(void)
*
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
*/
uint8_t
SImage_SendData
(
void
*
Buffer
,
uint16_t
Bytes
)
uint8_t
SImage_SendData
(
void
*
const
Buffer
,
const
uint16_t
Bytes
)
{
uint8_t
ErrorCode
;
...
...
@@ -225,7 +225,7 @@ uint8_t SImage_SendData(void* Buffer, uint16_t Bytes)
*
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum
*/
uint8_t
SImage_ReadData
(
void
*
Buffer
,
uint16_t
Bytes
)
uint8_t
SImage_ReadData
(
void
*
const
Buffer
,
const
uint16_t
Bytes
)
{
uint8_t
ErrorCode
;
...
...
Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h
View file @
fc8e4837
...
...
@@ -108,8 +108,8 @@
void
SImage_SendBlockHeader
(
void
);
uint8_t
SImage_ReceiveBlockHeader
(
void
);
uint8_t
SImage_ReceiveEventHeader
(
void
);
uint8_t
SImage_SendData
(
void
*
Buffer
,
uint16_t
Bytes
);
uint8_t
SImage_ReadData
(
void
*
Buffer
,
uint16_t
Bytes
);
uint8_t
SImage_SendData
(
void
*
const
Buffer
,
const
uint16_t
Bytes
);
uint8_t
SImage_ReadData
(
void
*
const
Buffer
,
const
uint16_t
Bytes
);
bool
SImage_IsEventReceived
(
void
);
#endif
LUFA.pnproj
View file @
fc8e4837
This diff is collapsed.
Click to expand it.
Projects/Incomplete/StandaloneProgrammer/DiskDevice.c
View file @
fc8e4837
...
...
@@ -89,7 +89,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface configuration structure being referenced
*/
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
bool
CommandSuccess
;
...
...
Projects/Incomplete/StandaloneProgrammer/DiskDevice.h
View file @
fc8e4837
...
...
@@ -55,7 +55,7 @@
void
EVENT_USB_Device_ConfigurationChanged
(
void
);
void
EVENT_USB_Device_UnhandledControlRequest
(
void
);
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
#endif
#endif
Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.c
View file @
fc8e4837
...
...
@@ -48,7 +48,7 @@
* \param[in] BlockAddress Data block starting address for the write sequence
* \param[in] TotalBlocks Number of blocks of data to write
*/
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
{
uint16_t
CurrDFPage
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
/
DATAFLASH_PAGE_SIZE
);
uint16_t
CurrDFPageByte
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
%
DATAFLASH_PAGE_SIZE
);
...
...
@@ -182,7 +182,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, co
* \param[in] BlockAddress Data block starting address for the read sequence
* \param[in] TotalBlocks Number of blocks of data to read
*/
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
{
uint16_t
CurrDFPage
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
/
DATAFLASH_PAGE_SIZE
);
uint16_t
CurrDFPageByte
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
%
DATAFLASH_PAGE_SIZE
);
...
...
Projects/Incomplete/StandaloneProgrammer/Lib/DataflashManager.h
View file @
fc8e4837
...
...
@@ -67,9 +67,9 @@
/* Function Prototypes: */
#if defined(USB_CAN_BE_DEVICE)
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
);
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
);
void
DataflashManager_WriteBlocks_RAM
(
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
,
const
uint8_t
*
BufferPtr
)
ATTR_NON_NULL_PTR_ARG
(
3
);
...
...
Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.c
View file @
fc8e4837
...
...
@@ -87,7 +87,7 @@ SCSI_Request_Sense_Response_t SenseData =
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
bool
SCSI_DecodeSCSICommand
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
bool
SCSI_DecodeSCSICommand
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
/* Set initial sense data, before the requested command is processed */
SCSI_SET_SENSE
(
SCSI_SENSE_KEY_GOOD
,
...
...
@@ -137,7 +137,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
uint16_t
AllocationLength
=
(((
uint16_t
)
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
3
]
<<
8
)
|
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
4
]);
...
...
@@ -175,7 +175,7 @@ static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
uint8_t
AllocationLength
=
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
4
];
uint8_t
BytesTransferred
=
(
AllocationLength
<
sizeof
(
SenseData
))
?
AllocationLength
:
sizeof
(
SenseData
);
...
...
@@ -195,7 +195,7 @@ static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInf
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
uint32_t
LastBlockAddressInLUN
=
(
VIRTUAL_MEMORY_BLOCKS
-
1
);
uint32_t
MediaBlockSize
=
VIRTUAL_MEMORY_BLOCK_SIZE
;
...
...
@@ -214,7 +214,7 @@ static void SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterface
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
/* Check to see if the SELF TEST bit is not set */
if
(
!
(
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
1
]
&
(
1
<<
2
)))
...
...
@@ -249,7 +249,7 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] IsDataRead Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
*/
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
bool
IsDataRead
)
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
bool
IsDataRead
)
{
uint32_t
BlockAddress
;
uint16_t
TotalBlocks
;
...
...
Projects/Incomplete/StandaloneProgrammer/Lib/SCSI.h
View file @
fc8e4837
...
...
@@ -76,11 +76,11 @@
bool
SCSI_DecodeSCSICommand
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
#if defined(INCLUDE_FROM_SCSI_C)
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
bool
IsDataRead
);
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
bool
IsDataRead
);
#endif
#endif
...
...
Projects/TemperatureDataLogger/Lib/DataflashManager.c
View file @
fc8e4837
...
...
@@ -47,7 +47,7 @@
* \param[in] BlockAddress Data block starting address for the write sequence
* \param[in] TotalBlocks Number of blocks of data to write
*/
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
{
uint16_t
CurrDFPage
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
/
DATAFLASH_PAGE_SIZE
);
uint16_t
CurrDFPageByte
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
%
DATAFLASH_PAGE_SIZE
);
...
...
@@ -181,7 +181,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* MSInterfaceInfo, co
* \param[in] BlockAddress Data block starting address for the read sequence
* \param[in] TotalBlocks Number of blocks of data to read
*/
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
)
{
uint16_t
CurrDFPage
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
/
DATAFLASH_PAGE_SIZE
);
uint16_t
CurrDFPageByte
=
((
BlockAddress
*
VIRTUAL_MEMORY_BLOCK_SIZE
)
%
DATAFLASH_PAGE_SIZE
);
...
...
Projects/TemperatureDataLogger/Lib/DataflashManager.h
View file @
fc8e4837
...
...
@@ -67,9 +67,9 @@
#define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
/* Function Prototypes: */
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
void
DataflashManager_WriteBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
);
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
void
DataflashManager_ReadBlocks
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
);
void
DataflashManager_WriteBlocks_RAM
(
const
uint32_t
BlockAddress
,
uint16_t
TotalBlocks
,
const
uint8_t
*
BufferPtr
)
ATTR_NON_NULL_PTR_ARG
(
3
);
...
...
Projects/TemperatureDataLogger/Lib/SCSI.c
View file @
fc8e4837
...
...
@@ -86,7 +86,7 @@ SCSI_Request_Sense_Response_t SenseData =
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
bool
SCSI_DecodeSCSICommand
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
bool
SCSI_DecodeSCSICommand
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
/* Set initial sense data, before the requested command is processed */
SCSI_SET_SENSE
(
SCSI_SENSE_KEY_GOOD
,
...
...
@@ -136,7 +136,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
uint16_t
AllocationLength
=
(((
uint16_t
)
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
3
]
<<
8
)
|
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
4
]);
...
...
@@ -174,7 +174,7 @@ static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
uint8_t
AllocationLength
=
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
4
];
uint8_t
BytesTransferred
=
(
AllocationLength
<
sizeof
(
SenseData
))
?
AllocationLength
:
sizeof
(
SenseData
);
...
...
@@ -194,7 +194,7 @@ static void SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* MSInterfaceInf
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
uint32_t
LastBlockAddressInLUN
=
(
VIRTUAL_MEMORY_BLOCKS
-
1
);
uint32_t
MediaBlockSize
=
VIRTUAL_MEMORY_BLOCK_SIZE
;
...
...
@@ -213,7 +213,7 @@ static void SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* MSInterface
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
*/
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
/* Check to see if the SELF TEST bit is not set */
if
(
!
(
MSInterfaceInfo
->
State
.
CommandBlock
.
SCSICommandData
[
1
]
&
(
1
<<
2
)))
...
...
@@ -248,7 +248,7 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* MSInterfaceI
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface structure that the command is associated with
* \param[in] IsDataRead Indicates if the command is a READ (10) command or WRITE (10) command (DATA_READ or DATA_WRITE)
*/
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
bool
IsDataRead
)
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
bool
IsDataRead
)
{
uint32_t
BlockAddress
;
uint16_t
TotalBlocks
;
...
...
Projects/TemperatureDataLogger/Lib/SCSI.h
View file @
fc8e4837
...
...
@@ -73,14 +73,14 @@
#define DEVICE_TYPE_CDROM 0x05
/* Function Prototypes: */
bool
SCSI_DecodeSCSICommand
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
bool
SCSI_DecodeSCSICommand
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
#if defined(INCLUDE_FROM_SCSI_C)
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
,
const
bool
IsDataRead
);
static
void
SCSI_Command_Inquiry
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_Request_Sense
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_Read_Capacity_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_Send_Diagnostic
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
static
void
SCSI_Command_ReadWrite_10
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
,
const
bool
IsDataRead
);
#endif
#endif
Projects/TemperatureDataLogger/TempDataLogger.c
View file @
fc8e4837
...
...
@@ -252,7 +252,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
*
* \param[in] MSInterfaceInfo Pointer to the Mass Storage class interface configuration structure being referenced
*/
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
)
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
)
{
bool
CommandSuccess
;
...
...
Projects/TemperatureDataLogger/TempDataLogger.h
View file @
fc8e4837
...
...
@@ -103,7 +103,7 @@
void
EVENT_USB_Device_ConfigurationChanged
(
void
);
void
EVENT_USB_Device_UnhandledControlRequest
(
void
);
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
MSInterfaceInfo
);
bool
CALLBACK_MS_Device_SCSICommandReceived
(
USB_ClassInfo_MS_Device_t
*
const
MSInterfaceInfo
);
bool
CALLBACK_HID_Device_CreateHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
uint8_t
*
const
ReportID
,
const
uint8_t
ReportType
,
void
*
ReportData
,
uint16_t
*
ReportSize
);
void
CALLBACK_HID_Device_ProcessHIDReport
(
USB_ClassInfo_HID_Device_t
*
const
HIDInterfaceInfo
,
const
uint8_t
ReportID
,
...
...
Projects/Webserver/Lib/DHCPClientApp.c
View file @
fc8e4837
...
...
@@ -176,7 +176,7 @@ void DHCPClientApp_Callback(void)
*
* \return Size in bytes of the created DHCP packet
*/
static
uint16_t
DHCPClientApp_FillDHCPHeader
(
DHCP_Header_t
*
DHCPHeader
,
uint8_t
DHCPMessageType
,
uip_udp_appstate_t
*
AppState
)
static
uint16_t
DHCPClientApp_FillDHCPHeader
(
DHCP_Header_t
*
const
DHCPHeader
,
const
uint8_t
DHCPMessageType
,
uip_udp_appstate_t
*
AppState
)
{
/* Erase existing packet data so that we start will all 0x00 DHCP header data */
memset
(
DHCPHeader
,
0
,
sizeof
(
DHCP_Header_t
));
...
...
@@ -239,7 +239,7 @@ static uint8_t DHCPClientApp_SetOption(uint8_t* DHCPOptionList, uint8_t Option,
*
* \return Boolean true if the option was found in the DHCP packet's options list, false otherwise
*/
static
bool
DHCPClientApp_GetOption
(
uint8_t
*
DHCPOptionList
,
uint8_t
Option
,
void
*
Destination
)
static
bool
DHCPClientApp_GetOption
(
const
uint8_t
*
DHCPOptionList
,
const
uint8_t
Option
,
void
*
const
Destination
)
{
/* Look through the incoming DHCP packet's options list for the requested option */
while
(
*
DHCPOptionList
!=
DHCP_OPTION_END
)
...
...
Projects/Webserver/Lib/DHCPClientApp.h
View file @
fc8e4837
...
...
@@ -160,10 +160,10 @@
void
DHCPClientApp_Callback
(
void
);
#if defined(INCLUDE_FROM_DHCPCLIENTAPP_C)
static
uint16_t
DHCPClientApp_FillDHCPHeader
(
DHCP_Header_t
*
DHCPHeader
,
uint8_t
DHCPMessageType
,
static
uint16_t
DHCPClientApp_FillDHCPHeader
(
DHCP_Header_t
*
const
DHCPHeader
,
const
uint8_t
DHCPMessageType
,
uip_udp_appstate_t
*
AppState
);
static
uint8_t
DHCPClientApp_SetOption
(
uint8_t
*
DHCPOptionList
,
uint8_t
Option
,
uint8_t
DataLen
,
void
*
OptionData
);
static
bool
DHCPClientApp_GetOption
(
uint8_t
*
DHCPOptionList
,
uint8_t
Option
,
void
*
Destination
);
static
bool
DHCPClientApp_GetOption
(
const
uint8_t
*
DHCPOptionList
,
const
uint8_t
Option
,
void
*
const
Destination
);
#endif
#endif
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment