aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/TempDataLogger
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-07-21 16:19:32 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-07-21 16:19:32 +0000
commit6bda628718f67c04ed43e8328f55bdce5319c504 (patch)
treeefd08eefa90cef94440f880a70902f5803fb12a7 /Projects/TempDataLogger
parent83e293a6ec98c7faad1b76dd312b31b86cbeecc1 (diff)
downloadlufa-6bda628718f67c04ed43e8328f55bdce5319c504.tar.gz
lufa-6bda628718f67c04ed43e8328f55bdce5319c504.tar.bz2
lufa-6bda628718f67c04ed43e8328f55bdce5319c504.zip
Update all demos, projects and bootloaders to indent all function parameters, one per line, for better readability.
Add missing const qualifiers to the demos.
Diffstat (limited to 'Projects/TempDataLogger')
-rw-r--r--Projects/TempDataLogger/Descriptors.c4
-rw-r--r--Projects/TempDataLogger/Descriptors.h5
-rw-r--r--Projects/TempDataLogger/Lib/DS1307.c16
-rw-r--r--Projects/TempDataLogger/Lib/DS1307.h17
-rw-r--r--Projects/TempDataLogger/Lib/DataflashManager.c16
-rw-r--r--Projects/TempDataLogger/Lib/DataflashManager.h12
-rw-r--r--Projects/TempDataLogger/Lib/SCSI.c3
-rw-r--r--Projects/TempDataLogger/Lib/SCSI.h3
-rw-r--r--Projects/TempDataLogger/TempDataLogger.c14
-rw-r--r--Projects/TempDataLogger/TempDataLogger.h14
10 files changed, 74 insertions, 30 deletions
diff --git a/Projects/TempDataLogger/Descriptors.c b/Projects/TempDataLogger/Descriptors.c
index 00a4d70fe..564d5ee83 100644
--- a/Projects/TempDataLogger/Descriptors.c
+++ b/Projects/TempDataLogger/Descriptors.c
@@ -237,7 +237,9 @@ USB_Descriptor_String_t PROGMEM ProductString =
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
* USB host.
*/
-uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
+uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
+ const uint8_t wIndex,
+ void** const DescriptorAddress)
{
const uint8_t DescriptorType = (wValue >> 8);
const uint8_t DescriptorNumber = (wValue & 0xFF);
diff --git a/Projects/TempDataLogger/Descriptors.h b/Projects/TempDataLogger/Descriptors.h
index a2ab5852e..ff0d25cff 100644
--- a/Projects/TempDataLogger/Descriptors.h
+++ b/Projects/TempDataLogger/Descriptors.h
@@ -54,7 +54,8 @@
} USB_Descriptor_Configuration_t;
/* Function Prototypes: */
- uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress)
- ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
+ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
+ const uint8_t wIndex,
+ void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
#endif
diff --git a/Projects/TempDataLogger/Lib/DS1307.c b/Projects/TempDataLogger/Lib/DS1307.c
index 003160fe2..a85aa6176 100644
--- a/Projects/TempDataLogger/Lib/DS1307.c
+++ b/Projects/TempDataLogger/Lib/DS1307.c
@@ -7,7 +7,9 @@
#include "DS1307.h"
-void DS1307_SetDate(uint8_t Day, uint8_t Month, uint8_t Year)
+void DS1307_SetDate(const uint8_t Day,
+ const uint8_t Month,
+ const uint8_t Year)
{
#if defined(DUMMY_RTC)
return;
@@ -32,7 +34,9 @@ void DS1307_SetDate(uint8_t Day, uint8_t Month, uint8_t Year)
}
}
-void DS1307_SetTime(uint8_t Hour, uint8_t Minute, uint8_t Second)
+void DS1307_SetTime(const uint8_t Hour,
+ const uint8_t Minute,
+ const uint8_t Second)
{
#if defined(DUMMY_RTC)
return;
@@ -59,7 +63,9 @@ void DS1307_SetTime(uint8_t Hour, uint8_t Minute, uint8_t Second)
}
}
-void DS1307_GetDate(uint8_t* Day, uint8_t* Month, uint8_t* Year)
+void DS1307_GetDate(uint8_t* const Day,
+ uint8_t* const Month,
+ uint8_t* const Year)
{
#if defined(DUMMY_RTC)
*Day = 1;
@@ -91,7 +97,9 @@ void DS1307_GetDate(uint8_t* Day, uint8_t* Month, uint8_t* Year)
*Year = (CurrentRTCDate.Byte3.Fields.TenYear * 10) + CurrentRTCDate.Byte3.Fields.Year;
}
-void DS1307_GetTime(uint8_t* Hour, uint8_t* Minute, uint8_t* Second)
+void DS1307_GetTime(uint8_t* const Hour,
+ uint8_t* const Minute,
+ uint8_t* const Second)
{
#if defined(DUMMY_RTC)
*Hour = 1;
diff --git a/Projects/TempDataLogger/Lib/DS1307.h b/Projects/TempDataLogger/Lib/DS1307.h
index 58eac8e5c..d07bff439 100644
--- a/Projects/TempDataLogger/Lib/DS1307.h
+++ b/Projects/TempDataLogger/Lib/DS1307.h
@@ -100,10 +100,17 @@
#define DS1307_ADDRESS_WRITE 0b11010000
/* Function Prototypes: */
- void DS1307_SetDate(uint8_t Day, uint8_t Month, uint8_t Year);
- void DS1307_SetTime(uint8_t Hour, uint8_t Minute, uint8_t Second);
-
- void DS1307_GetDate(uint8_t* Day, uint8_t* Month, uint8_t* Year);
- void DS1307_GetTime(uint8_t* Hour, uint8_t* Minute, uint8_t* Second);
+ void DS1307_SetDate(const uint8_t Day,
+ const uint8_t Month,
+ const uint8_t Year);
+ void DS1307_SetTime(const uint8_t Hour,
+ const uint8_t Minute,
+ const uint8_t Second);
+ void DS1307_GetDate(uint8_t* const Day,
+ uint8_t* const Month,
+ uint8_t* const Year);
+ void DS1307_GetTime(uint8_t* const Hour,
+ uint8_t* const Minute,
+ uint8_t* const Second);
#endif
diff --git a/Projects/TempDataLogger/Lib/DataflashManager.c b/Projects/TempDataLogger/Lib/DataflashManager.c
index 48c4fa7e6..1750e15b3 100644
--- a/Projects/TempDataLogger/Lib/DataflashManager.c
+++ b/Projects/TempDataLogger/Lib/DataflashManager.c
@@ -47,7 +47,9 @@
* \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* const 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 +183,9 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
* \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* const 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);
@@ -289,7 +293,9 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
* \param[in] TotalBlocks Number of blocks of data to write
* \param[in] BufferPtr Pointer to the data source RAM buffer
*/
-void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, const uint8_t* BufferPtr)
+void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
+ uint16_t TotalBlocks,
+ const uint8_t* BufferPtr)
{
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
@@ -388,7 +394,9 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t Tota
* \param[in] TotalBlocks Number of blocks of data to read
* \param[out] BufferPtr Pointer to the data destination RAM buffer
*/
-void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks, uint8_t* BufferPtr)
+void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
+ uint16_t TotalBlocks,
+ uint8_t* BufferPtr)
{
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
diff --git a/Projects/TempDataLogger/Lib/DataflashManager.h b/Projects/TempDataLogger/Lib/DataflashManager.h
index 3c75c4c75..70dd88d21 100644
--- a/Projects/TempDataLogger/Lib/DataflashManager.h
+++ b/Projects/TempDataLogger/Lib/DataflashManager.h
@@ -67,13 +67,17 @@
#define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
/* Function Prototypes: */
- void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const 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* const 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,
+ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
+ uint16_t TotalBlocks,
const uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
- void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t TotalBlocks,
+ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
+ uint16_t TotalBlocks,
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
void DataflashManager_ResetDataflashProtections(void);
bool DataflashManager_CheckDataflashOperation(void);
diff --git a/Projects/TempDataLogger/Lib/SCSI.c b/Projects/TempDataLogger/Lib/SCSI.c
index fb841e34b..390441aa1 100644
--- a/Projects/TempDataLogger/Lib/SCSI.c
+++ b/Projects/TempDataLogger/Lib/SCSI.c
@@ -247,7 +247,8 @@ static void SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInte
* \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* const MSInterfaceInfo, const bool IsDataRead)
+static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
+ const bool IsDataRead)
{
uint32_t BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
uint16_t TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
diff --git a/Projects/TempDataLogger/Lib/SCSI.h b/Projects/TempDataLogger/Lib/SCSI.h
index fd739182e..c5504b713 100644
--- a/Projects/TempDataLogger/Lib/SCSI.h
+++ b/Projects/TempDataLogger/Lib/SCSI.h
@@ -80,7 +80,8 @@
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);
+ static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
+ const bool IsDataRead);
#endif
#endif
diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c
index e7c7c763e..dd707bc08 100644
--- a/Projects/TempDataLogger/TempDataLogger.c
+++ b/Projects/TempDataLogger/TempDataLogger.c
@@ -279,8 +279,11 @@ bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* const MSI
*
* \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
*/
-bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
- const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
+bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
+ uint8_t* const ReportID,
+ const uint8_t ReportType,
+ void* ReportData,
+ uint16_t* const ReportSize)
{
Device_Report_t* ReportParams = (Device_Report_t*)ReportData;
@@ -301,8 +304,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
* \param[in] ReportData Pointer to a buffer where the created report has been stored
* \param[in] ReportSize Size in bytes of the received HID report
*/
-void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
- const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
+void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
+ const uint8_t ReportID,
+ const uint8_t ReportType,
+ const void* ReportData,
+ const uint16_t ReportSize)
{
Device_Report_t* ReportParams = (Device_Report_t*)ReportData;
diff --git a/Projects/TempDataLogger/TempDataLogger.h b/Projects/TempDataLogger/TempDataLogger.h
index 48a051f0a..45cb3bec1 100644
--- a/Projects/TempDataLogger/TempDataLogger.h
+++ b/Projects/TempDataLogger/TempDataLogger.h
@@ -105,9 +105,15 @@
void EVENT_USB_Device_UnhandledControlRequest(void);
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* const ReportSize);
- void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
- const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize);
+ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
+ uint8_t* const ReportID,
+ const uint8_t ReportType,
+ void* ReportData,
+ uint16_t* const ReportSize);
+ void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
+ const uint8_t ReportID,
+ const uint8_t ReportType,
+ const void* ReportData,
+ const uint16_t ReportSize);
#endif