]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
displayd: Update camera variables to new types.
authorMichal Vokac <vokac.m@gmail.com>
Thu, 15 Dec 2011 00:53:08 +0000 (01:53 +0100)
committerMichal Vokac <vokac.m@gmail.com>
Thu, 15 Dec 2011 00:53:08 +0000 (01:53 +0100)
src/displayd/displayd.c

index c25639d95f39adf200131e98bc1411507fcbeafb..29f9eaa781dbf262a856315f64b3c9db9eeb7782 100644 (file)
@@ -244,7 +244,7 @@ void rcv_camera_result_cb(const ORTERecvInfo *info, void *vinstance,
        static UDE_hw_status_t last_status;
        static struct timespec last_sent;
        struct camera_result_type *instance = (struct camera_result_type *)vinstance;
-       char s, c;
+       char valid;
        switch (info->status) {
                case NEW_DATA:
                        if (instance->error == 0)
@@ -264,13 +264,11 @@ void rcv_camera_result_cb(const ORTERecvInfo *info, void *vinstance,
        last_status = status;
 
        if (status == STATUS_OK) {
-               s = (instance->side >= 0 && instance->side < 10) ?
-                       '0'+instance->side : 'E';
-               c = (instance->center >= 0 && instance->center < 10) ?
-                       '0'+instance->center : 'E';
-       } else
-               s = c = '-';
-       uoled_display_corns(s, c);
+               valid = (instance->target_valid > 0 ? 1 : 0);
+       } else {
+               valid = '-';
+        }
+       uoled_display_corns(valid, '-');
 }
 
 void rcv_hokuyo_scan_cb(const ORTERecvInfo *info, void *vinstance,