Skip to content

Commit bb40cb1

Browse files
committed
MCU8MASS-348 MCU8MASS-942 MCU8MASS-976 Formatting
1 parent 2a0c202 commit bb40cb1

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

src/ecc608.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
static bool initialized = false;
77

8-
uint8_t ECC608Class::getEndpoint(uint8_t *endpoint, uint8_t *length) {
8+
uint8_t ECC608Class::getEndpoint(uint8_t* endpoint, uint8_t* length) {
99
return this->readProvisionItem(AWS_ENDPOINT, endpoint, length);
1010
}
1111

12-
uint8_t ECC608Class::getThingName(uint8_t *thingName, uint8_t *length) {
12+
uint8_t ECC608Class::getThingName(uint8_t* thingName, uint8_t* length) {
1313
return this->readProvisionItem(AWS_THINGNAME, thingName, length);
1414
}
1515

@@ -37,8 +37,8 @@ uint8_t ECC608Class::begin() {
3737
}
3838

3939
uint8_t ECC608Class::readProvisionItem(enum ecc_data_types type,
40-
uint8_t *buffer,
41-
uint8_t *length) {
40+
uint8_t* buffer,
41+
uint8_t* length) {
4242
uint8_t atca_status = ATCA_SUCCESS;
4343
// Use union for data header to avoid pointer casting
4444
union {
@@ -49,8 +49,9 @@ uint8_t ECC608Class::readProvisionItem(enum ecc_data_types type,
4949
uint16_t offset = 0;
5050

5151
// Determine slot size
52-
if ((atca_status = atcab_get_zone_size(
53-
ATCA_ZONE_DATA, SLOT_NUM, &slot_size)) != ATCA_SUCCESS) {
52+
if ((atca_status = atcab_get_zone_size(ATCA_ZONE_DATA,
53+
SLOT_NUM,
54+
&slot_size)) != ATCA_SUCCESS) {
5455
*length = 0;
5556
return atca_status;
5657
}
@@ -59,9 +60,11 @@ uint8_t ECC608Class::readProvisionItem(enum ecc_data_types type,
5960
// *length
6061
do {
6162
// Read data header from ECC slot
62-
if ((atca_status = atcab_read_bytes_zone(
63-
ATCA_ZONE_DATA, SLOT_NUM, offset, h.bytes, sizeof(h))) !=
64-
ATCA_SUCCESS) {
63+
if ((atca_status = atcab_read_bytes_zone(ATCA_ZONE_DATA,
64+
SLOT_NUM,
65+
offset,
66+
h.bytes,
67+
sizeof(h))) != ATCA_SUCCESS) {
6568
*length = 0;
6669
return atca_status;
6770
}
@@ -79,7 +82,7 @@ uint8_t ECC608Class::readProvisionItem(enum ecc_data_types type,
7982
*length = 0;
8083
return atca_status;
8184
}
82-
*length = size;
85+
*length = size;
8386
buffer[size] = '\0';
8487
return this->ERR_OK;
8588
} else {
@@ -92,4 +95,4 @@ uint8_t ECC608Class::readProvisionItem(enum ecc_data_types type,
9295

9396
*length = 0;
9497
return this->ERR_NOTFOUND;
95-
}
98+
}

src/log.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,29 @@ LogClass Log(&Serial5);
2121
#endif
2222
#endif
2323

24-
int16_t printf_putchar(char c, FILE *fp) {
25-
((class Print *)(fdev_get_udata(fp)))->write((uint8_t)c);
24+
int16_t printf_putchar(char c, FILE* fp) {
25+
((class Print*)(fdev_get_udata(fp)))->write((uint8_t)c);
2626
return 0;
2727
}
2828

29-
void LogClass::print(const char *str, const char level[]) {
29+
void LogClass::print(const char* str, const char level[]) {
3030
this->uart->printf("%s%s\r\n", level, str);
3131
}
3232

33-
LogClass::LogClass(UartClass *uart) {
33+
LogClass::LogClass(UartClass* uart) {
3434
this->uart = uart;
35-
log_level = LogLevel::INFO;
35+
log_level = LogLevel::INFO;
3636
}
3737

38-
void LogClass::setOutputUart(UartClass *uart) { this->uart = uart; }
38+
void LogClass::setOutputUart(UartClass* uart) { this->uart = uart; }
3939

4040
void LogClass::setLogLevel(const LogLevel log_level) {
4141
this->log_level = log_level;
4242
}
4343

4444
LogLevel LogClass::getLogLevel(void) { return log_level; }
4545

46-
bool LogClass::setLogLevelStr(const char *log_level) {
46+
bool LogClass::setLogLevelStr(const char* log_level) {
4747
LogLevel ll = LogLevel::NONE;
4848
if (strstr(log_level, "debug") != NULL) {
4949
ll = LogLevel::DEBUG;
@@ -75,7 +75,7 @@ void LogClass::info(const char str[]) {
7575

7676
void LogClass::info(const String str) { this->info(str.c_str()); }
7777

78-
void LogClass::infof(const char *format, ...) {
78+
void LogClass::infof(const char* format, ...) {
7979
if (log_level >= LogLevel::INFO) {
8080

8181
// Append format with [ERROR]
@@ -101,7 +101,7 @@ void LogClass::debug(const char str[]) {
101101

102102
void LogClass::debug(const String str) { this->debug(str.c_str()); }
103103

104-
void LogClass::debugf(const char *format, ...) {
104+
void LogClass::debugf(const char* format, ...) {
105105
if (log_level >= LogLevel::DEBUG) {
106106

107107
// Append format with [ERROR]
@@ -129,7 +129,7 @@ void LogClass::raw(const char str[]) {
129129

130130
void LogClass::raw(const String str) { this->raw(str.c_str()); }
131131

132-
void LogClass::rawf(const char *format, ...) {
132+
void LogClass::rawf(const char* format, ...) {
133133
FILE f;
134134
va_list ap;
135135

@@ -147,7 +147,7 @@ void LogClass::error(const char str[]) {
147147

148148
void LogClass::error(const String str) { this->error(str.c_str()); }
149149

150-
void LogClass::errorf(const char *format, ...) {
150+
void LogClass::errorf(const char* format, ...) {
151151
if (log_level >= LogLevel::ERROR) {
152152

153153
// Append format with [ERROR]
@@ -172,7 +172,7 @@ void LogClass::warn(const char str[]) {
172172

173173
void LogClass::warn(const String str) { this->warn(str.c_str()); }
174174

175-
void LogClass::warnf(const char *format, ...) {
175+
void LogClass::warnf(const char* format, ...) {
176176
if (log_level >= LogLevel::WARN) {
177177

178178
// Append format with [ERROR]

0 commit comments

Comments
 (0)