200 |
200 |
201 int server(void) |
201 int server(void) |
202 { |
202 { |
203 char buf[1024]; |
203 char buf[1024]; |
204 w1_therm *tmp1, *old1; |
204 w1_therm *tmp1, *old1; |
205 int run = 0; |
205 int rc, run = 0; |
206 |
206 |
207 my_mosquitto_init(); |
207 my_mosquitto_init(); |
|
208 |
|
209 rc = piThreadCreate (my_sensors_loop); |
|
210 if (rc) { |
|
211 fprintf(stderr, "my_sensors_loop thread didn't start\n"); |
|
212 } else { |
|
213 if (debug) |
|
214 fprintf(stdout, "Thread my_sensors_loop started\n"); |
|
215 } |
208 |
216 |
209 do { |
217 do { |
210 lcdupdate = FALSE; |
218 lcdupdate = FALSE; |
211 |
219 |
212 my_sensors_loop(); |
|
213 run = my_mosquitto_loop(); |
220 run = my_mosquitto_loop(); |
214 |
221 |
215 if (run && lcdupdate) { |
222 if (run && lcdupdate) { |
216 lcdPosition(lcdHandle, 0, 0); |
223 lcdPosition(lcdHandle, 0, 0); |
217 tmp1 = Config.w1therms; |
224 tmp1 = Config.w1therms; |