Skip to content

Commit

Permalink
Change logging macros to Log class
Browse files Browse the repository at this point in the history
  • Loading branch information
eberseth committed Nov 6, 2021
1 parent 5d1c825 commit 6d0121e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/bmi160/src/bmi160.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int Bmi160::begin(const TwoWire* interface, uint8_t address, pin_t interruptPin,

if (os_queue_create(&motionSyncQueue_, sizeof(Bmi160EventType), eventDepth, nullptr)) {
motionSyncQueue_ = nullptr;
LOG(ERROR, "os_queue_create() failed");
Log.error("os_queue_create() failed");
return SYSTEM_ERROR_INTERNAL;
}

Expand All @@ -132,7 +132,7 @@ int Bmi160::begin(const TwoWire* interface, uint8_t address, pin_t interruptPin,
wire_->begin();
wire_->beginTransmission(address);
if (wire_->endTransmission() != 0) {
LOG(ERROR, "address invalid or device failed");
Log.error("address invalid or device failed");
return SYSTEM_ERROR_IO;
}

Expand All @@ -152,7 +152,7 @@ int Bmi160::begin(const SPIClass& interface, pin_t selectPin, pin_t interruptPin

if (os_queue_create(&motionSyncQueue_, sizeof(Bmi160EventType), eventDepth, nullptr)) {
motionSyncQueue_ = nullptr;
LOG(ERROR, "os_queue_create() failed");
Log.error("os_queue_create() failed");
return SYSTEM_ERROR_INTERNAL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/location_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int LocationService::begin(bool fastLock) {
UBLOX_TX_READY_MCU_PIN,
UBLOX_TX_READY_GPS_PIN);
if (!gps_) {
LOG(ERROR, "ubloxGPS instantiation failed");
Log.error("ubloxGPS instantiation failed");
ret = SYSTEM_ERROR_INTERNAL;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions src/motion_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int MotionService::start(size_t eventDepth) {
// Retrieve (if first time) instance of the BMI160 IMU device
ret = BMI160.begin(BMI160_SPI_INTERFACE, BMI160_SPI_CS_PIN, BMI160_INT_PIN);
if (ret != SYSTEM_ERROR_NONE) {
LOG(ERROR, "BMI160.begin() failed");
Log.error("BMI160.begin() failed");
return ret;
}

Expand All @@ -107,14 +107,14 @@ int MotionService::start(size_t eventDepth) {
eventDepth_ = eventDepth;
if (!motionEventQueue_ && os_queue_create(&motionEventQueue_, sizeof(MotionEvent), eventDepth, nullptr)) {
motionEventQueue_ = nullptr;
LOG(ERROR, "os_queue_create() failed");
Log.error("os_queue_create() failed");
return SYSTEM_ERROR_INTERNAL;
}

// Start the main MotionService thread
ret = os_thread_create(&thread_, "MOTSERV", OS_THREAD_PRIORITY_DEFAULT, MotionService::thread, this, OS_THREAD_STACK_SIZE_DEFAULT);
if (ret) {
LOG(ERROR, "os_thread_create() failed");
Log.error("os_thread_create() failed");
return ret;
}

Expand Down

0 comments on commit 6d0121e

Please sign in to comment.