浏览代码

Changed useless pass by ref argument in gps::getVelocity

tags/v1.2.0
Bertrand Lemasle 7 年前
父节点
当前提交
2d9121855c
共有 4 个文件被更改,包括 9 次插入10 次删除
  1. +3
    -7
      GpsTracker/Core.cpp
  2. +1
    -1
      GpsTracker/Core.h
  3. +4
    -1
      GpsTracker/Gps.cpp
  4. +1
    -1
      GpsTracker/Gps.h

+ 3
- 7
GpsTracker/Core.cpp 查看文件

@@ -13,7 +13,7 @@ namespace core {
PositionEntryMetadata metadata;
if (positions::acquire(metadata)) {
positions::appendLast(metadata);
updateSleepTime();
setSleepTime();
}

if (positions::needsToSend()) {
@@ -21,12 +21,8 @@ namespace core {
}
}

void updateSleepTime() {
VERBOSE("updateSleepTime");

uint8_t velocity;
gps::getVelocity(velocity);
setSleepTime(velocity);
void setSleepTime() {
setSleepTime(gps::getVelocity());
}

void setSleepTime(uint8_t velocity) {


+ 1
- 1
GpsTracker/Core.h 查看文件

@@ -15,5 +15,5 @@ namespace core {

void main();
void setSleepTime(uint8_t velocity);
void updateSleepTime();
void setSleepTime();
}

+ 4
- 1
GpsTracker/Gps.cpp 查看文件

@@ -44,10 +44,13 @@ namespace gps {
return currentStatus;
}

void getVelocity(uint8_t &velocity) {
uint8_t getVelocity() {
uint8_t velocity;
hardware::sim808::device.getGpsField(lastPosition, SIM808_GPS_FIELD::SPEED, &velocity);

VERBOSE_FORMAT("getVelocity", "%d", velocity);

return velocity;
}

void getTime(tmElements_t &time) {


+ 1
- 1
GpsTracker/Gps.h 查看文件

@@ -17,6 +17,6 @@ namespace gps {

SIM808_GPS_STATUS acquireCurrentPosition(uint16_t timeout);

void getVelocity(uint8_t &velocity);
uint8_t getVelocity();
void getTime(tmElements_t &time);
}

正在加载...
取消
保存