diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-07-21 14:00:51 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-07-21 14:00:51 +0000 |
commit | 97143bf81480d3f642e33684349c601d5cd0b1ae (patch) | |
tree | 667d25fd86b6d59e9ed4b60923cffb8a43ac4d62 /LUFA/Drivers/Peripheral | |
parent | 99d8a3936384d1e9286dfecfb6f7896294cd6c11 (diff) | |
download | lufa-97143bf81480d3f642e33684349c601d5cd0b1ae.tar.gz lufa-97143bf81480d3f642e33684349c601d5cd0b1ae.tar.bz2 lufa-97143bf81480d3f642e33684349c601d5cd0b1ae.zip |
Add missing const qualifiers to class drivers.
Indent core library function parameters so that there is only one parameter per line, to increase readability.
Diffstat (limited to 'LUFA/Drivers/Peripheral')
-rw-r--r-- | LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h | 8 | ||||
-rw-r--r-- | LUFA/Drivers/Peripheral/Serial.c | 4 | ||||
-rw-r--r-- | LUFA/Drivers/Peripheral/Serial.h | 7 | ||||
-rw-r--r-- | LUFA/Drivers/Peripheral/SerialStream.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/Peripheral/SerialStream.h | 6 | ||||
-rw-r--r-- | LUFA/Drivers/Peripheral/TWI.c | 3 |
6 files changed, 19 insertions, 12 deletions
diff --git a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h index 32d8c2522..8b289fb66 100644 --- a/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h +++ b/LUFA/Drivers/Peripheral/AVRU4U6U7/TWI.h @@ -99,7 +99,7 @@ * * \return Boolean true if the recipient ACKed the byte, false otherwise */ - static inline bool TWI_SendByte(uint8_t Byte) + static inline bool TWI_SendByte(const uint8_t Byte) { TWDR = Byte; TWCR = ((1 << TWINT) | (1 << TWEN)); @@ -115,7 +115,8 @@ * * \return Boolean true if the byte reception successfully completed, false otherwise */ - static inline bool TWI_ReceiveByte(uint8_t* Byte, bool LastByte) + static inline bool TWI_ReceiveByte(uint8_t* const Byte, + const bool LastByte) { uint8_t TWCRMask = ((1 << TWINT) | (1 << TWEN)); @@ -137,7 +138,8 @@ * * \return Boolean true if the device is ready for data, false otherwise */ - bool TWI_StartTransmission(uint8_t SlaveAddress, uint8_t TimeoutMS); + bool TWI_StartTransmission(const uint8_t SlaveAddress, + const uint8_t TimeoutMS); /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/LUFA/Drivers/Peripheral/Serial.c b/LUFA/Drivers/Peripheral/Serial.c index 0d97e28b8..b1141de14 100644 --- a/LUFA/Drivers/Peripheral/Serial.c +++ b/LUFA/Drivers/Peripheral/Serial.c @@ -30,7 +30,7 @@ #include "Serial.h" -void Serial_TxString_P(const char *FlashStringPtr) +void Serial_TxString_P(const char* FlashStringPtr) { uint8_t CurrByte; @@ -41,7 +41,7 @@ void Serial_TxString_P(const char *FlashStringPtr) } } -void Serial_TxString(const char *StringPtr) +void Serial_TxString(const char* StringPtr) { uint8_t CurrByte; diff --git a/LUFA/Drivers/Peripheral/Serial.h b/LUFA/Drivers/Peripheral/Serial.h index 103c7dbbc..83bdbbf00 100644 --- a/LUFA/Drivers/Peripheral/Serial.h +++ b/LUFA/Drivers/Peripheral/Serial.h @@ -92,13 +92,13 @@ * * \param[in] FlashStringPtr Pointer to a string located in program space. */ - void Serial_TxString_P(const char *FlashStringPtr) ATTR_NON_NULL_PTR_ARG(1); + void Serial_TxString_P(const char* FlashStringPtr) ATTR_NON_NULL_PTR_ARG(1); /** Transmits a given string located in SRAM memory through the USART. * * \param[in] StringPtr Pointer to a string located in SRAM space. */ - void Serial_TxString(const char *StringPtr) ATTR_NON_NULL_PTR_ARG(1); + void Serial_TxString(const char* StringPtr) ATTR_NON_NULL_PTR_ARG(1); /* Inline Functions: */ /** Initializes the USART, ready for serial data transmission and reception. This initializes the interface to @@ -107,7 +107,8 @@ * \param[in] BaudRate Serial baud rate, in bits per second. * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. */ - static inline void Serial_Init(const uint32_t BaudRate, const bool DoubleSpeed) + static inline void Serial_Init(const uint32_t BaudRate, + const bool DoubleSpeed) { UCSR1A = (DoubleSpeed ? (1 << U2X1) : 0); UCSR1B = ((1 << TXEN1) | (1 << RXEN1)); diff --git a/LUFA/Drivers/Peripheral/SerialStream.c b/LUFA/Drivers/Peripheral/SerialStream.c index 998f4734d..36a054876 100644 --- a/LUFA/Drivers/Peripheral/SerialStream.c +++ b/LUFA/Drivers/Peripheral/SerialStream.c @@ -33,7 +33,8 @@ FILE USARTStream = FDEV_SETUP_STREAM(SerialStream_TxByte, SerialStream_RxByte, _FDEV_SETUP_RW); -static int SerialStream_TxByte(char DataByte, FILE *Stream) +static int SerialStream_TxByte(char DataByte, + FILE *Stream) { (void)Stream; diff --git a/LUFA/Drivers/Peripheral/SerialStream.h b/LUFA/Drivers/Peripheral/SerialStream.h index 2b7362864..9a40048f6 100644 --- a/LUFA/Drivers/Peripheral/SerialStream.h +++ b/LUFA/Drivers/Peripheral/SerialStream.h @@ -74,7 +74,8 @@ /* Function Prototypes: */ #if defined(__INCLUDE_FROM_SERIALSTREAM_C) - static int SerialStream_TxByte(char DataByte, FILE *Stream) ATTR_NON_NULL_PTR_ARG(2); + static int SerialStream_TxByte(char DataByte, + FILE *Stream) ATTR_NON_NULL_PTR_ARG(2); static int SerialStream_RxByte(FILE *Stream) ATTR_NON_NULL_PTR_ARG(1); #endif #endif @@ -87,7 +88,8 @@ * \param[in] BaudRate Baud rate to configure the USART to. * \param[in] DoubleSpeed Enables double speed mode when set, halving the sample time to double the baud rate. */ - static inline void SerialStream_Init(const uint32_t BaudRate, const bool DoubleSpeed) + static inline void SerialStream_Init(const uint32_t BaudRate, + const bool DoubleSpeed) { Serial_Init(BaudRate, DoubleSpeed); diff --git a/LUFA/Drivers/Peripheral/TWI.c b/LUFA/Drivers/Peripheral/TWI.c index bd6e85384..b8aec4852 100644 --- a/LUFA/Drivers/Peripheral/TWI.c +++ b/LUFA/Drivers/Peripheral/TWI.c @@ -7,7 +7,8 @@ #include "TWI.h" -bool TWI_StartTransmission(uint8_t SlaveAddress, uint8_t TimeoutMS) +bool TWI_StartTransmission(const uint8_t SlaveAddress, + const uint8_t TimeoutMS) { for (;;) { |