Skip to content

Commit

Permalink
Reduce temp task rate; Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalentity committed Mar 9, 2018
1 parent a6f02b3 commit eb74b6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/fc/fc_tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ cfTask_t cfTasks[TASK_COUNT] = {
[TASK_TEMPERATURE] = {
.taskName = "TEMPERATURE",
.taskFunc = taskUpdateTemperature,
.desiredPeriod = TASK_PERIOD_HZ(10), // 10 Hz
.desiredPeriod = TASK_PERIOD_HZ(1), // 1 Hz
.staticPriority = TASK_PRIORITY_LOW,
},

Expand Down
4 changes: 2 additions & 2 deletions src/main/sensors/temperature.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
static bool tempSensorValid[TEMP_COUNT];
static int16_t tempSensorValue[TEMP_COUNT];

bool isTemperatureSensorValid(tempSensor_t sensor)
bool isTemperatureSensorValid(tempSensor_e sensor)
{
return tempSensorValid[sensor];
}

int16_t getTemperature(tempSensor_t sensor)
int16_t getTemperature(tempSensor_e sensor)
{
return tempSensorValue[sensor];
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/sensors/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

#include "config/parameter_group.h"

typedef enum tempSensor_e {
typedef enum {
TEMP_GYRO = 0,
TEMP_COUNT
} tempSensor_t;
} tempSensor_e;

// Temperature is returned in degC*10

bool isTemperatureSensorValid(tempSensor_t sensor);
int16_t getTemperature(tempSensor_t sensor);
bool isTemperatureSensorValid(tempSensor_e sensor);
int16_t getTemperature(tempSensor_e sensor);
void temperatureUpdate(void);

0 comments on commit eb74b6a

Please sign in to comment.