Skip to content

Commit 60867ff

Browse files
committed
Use const for waitForByte function arguments
1 parent d68976d commit 60867ff

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/sequans_controller.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,13 @@ void SequansControllerClass::responseResultToString(
803803
}
804804
}
805805

806-
uint8_t SequansControllerClass::waitForByte(uint8_t byte, uint32_t timeout) {
807-
uint8_t readByte = SequansController.readByte();
806+
uint8_t SequansControllerClass::waitForByte(const uint8_t byte,
807+
const uint32_t timeout) {
808+
int16_t read_byte = SequansController.readByte();
808809
uint32_t start = millis();
809810

810-
while (readByte != byte) {
811-
readByte = SequansController.readByte();
811+
while (read_byte != byte) {
812+
read_byte = SequansController.readByte();
812813

813814
if (millis() - start > timeout) {
814815
return SEQUANS_CONTROLLER_READ_BYTE_TIMEOUT;

src/sequans_controller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class SequansControllerClass {
212212
* @return #SEQUANS_CONTROLLER_READ_BYTE_OK if ok
213213
* #SEQUANS_CONTROLLER_READ_BYTE_TIMEOUT if timeout happened
214214
*/
215-
uint8_t waitForByte(uint8_t byte, uint32_t timeout_ms);
215+
uint8_t waitForByte(const uint8_t byte, const uint32_t timeout_ms);
216216

217217
void startCriticalSection(void);
218218

0 commit comments

Comments
 (0)