Fixed compiler warnings
This commit is contained in:
parent
f4f84ffca4
commit
a56793f401
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
#include "lib/sensors.h"
|
#include "lib/sensors.h"
|
||||||
|
|
||||||
extern struct sensors_sensor *sensors[];
|
const extern struct sensors_sensor *sensors[];
|
||||||
extern unsigned char sensors_flags[];
|
extern unsigned char sensors_flags[];
|
||||||
|
|
||||||
#define FLAG_CHANGED 0x80
|
#define FLAG_CHANGED 0x80
|
||||||
|
@ -63,13 +63,13 @@ get_sensor_index(const struct sensors_sensor *s)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
struct sensors_sensor *
|
const struct sensors_sensor *
|
||||||
sensors_first(void)
|
sensors_first(void)
|
||||||
{
|
{
|
||||||
return sensors[0];
|
return sensors[0];
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
struct sensors_sensor *
|
const struct sensors_sensor *
|
||||||
sensors_next(const struct sensors_sensor *s)
|
sensors_next(const struct sensors_sensor *s)
|
||||||
{
|
{
|
||||||
return sensors[get_sensor_index(s) + 1];
|
return sensors[get_sensor_index(s) + 1];
|
||||||
|
@ -82,7 +82,7 @@ sensors_changed(const struct sensors_sensor *s)
|
||||||
process_poll(&sensors_process);
|
process_poll(&sensors_process);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
struct sensors_sensor *
|
const struct sensors_sensor *
|
||||||
sensors_find(const char *prefix)
|
sensors_find(const char *prefix)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -123,7 +123,7 @@ PROCESS_THREAD(sensors_process, ev, data)
|
||||||
events = 0;
|
events = 0;
|
||||||
for(i = 0; i < num_sensors; ++i) {
|
for(i = 0; i < num_sensors; ++i) {
|
||||||
if(sensors_flags[i] & FLAG_CHANGED) {
|
if(sensors_flags[i] & FLAG_CHANGED) {
|
||||||
if(process_post(PROCESS_BROADCAST, sensors_event, sensors[i]) == PROCESS_ERR_OK) {
|
if(process_post(PROCESS_BROADCAST, sensors_event, (void *)sensors[i]) == PROCESS_ERR_OK) {
|
||||||
PROCESS_WAIT_EVENT_UNTIL(ev == sensors_event);
|
PROCESS_WAIT_EVENT_UNTIL(ev == sensors_event);
|
||||||
}
|
}
|
||||||
sensors_flags[i] &= ~FLAG_CHANGED;
|
sensors_flags[i] &= ~FLAG_CHANGED;
|
||||||
|
|
|
@ -60,9 +60,9 @@ struct sensors_sensor {
|
||||||
int (* status) (int type);
|
int (* status) (int type);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sensors_sensor *sensors_find(const char *type);
|
const struct sensors_sensor *sensors_find(const char *type);
|
||||||
struct sensors_sensor *sensors_next(const struct sensors_sensor *s);
|
const struct sensors_sensor *sensors_next(const struct sensors_sensor *s);
|
||||||
struct sensors_sensor *sensors_first(void);
|
const struct sensors_sensor *sensors_first(void);
|
||||||
|
|
||||||
void sensors_changed(const struct sensors_sensor *s);
|
void sensors_changed(const struct sensors_sensor *s);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue