I2C hang recover function added

Dependencies:   UniGraphic mbed vt100

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers edge_chart.cpp Source File

edge_chart.cpp

00001 #include "mbed.h"
00002 #include "edge_mgr.h"
00003 #include "edge_reset_mgr.h"
00004 #include "edge_chart.h"
00005 #if 0
00006 typedef struct _edge_chart_st {
00007     char *name ;
00008     int left ;
00009     int top ;
00010     int width ;
00011     int height ;
00012     int index ;
00013     int min ;
00014     int max ;
00015 } edge_chart_type ;
00016 
00017 extern edge_chart_type edge_chart[] ;
00018 #endif
00019 
00020 edge_chart_type edge_chart[] = {
00021 /*      name,  left, top, width, height, index,   min,     max */
00022     { "Accel",    0,   0,   160,     60,     0,  -0.2,     0.2 },
00023     { "Color",  160,   0,   160,    120,     0,   0.0, 10000.0 },
00024     { "Color2", 160, 120,   160,    120,     0,   0.0, 10000.0 },
00025     { "Temp",     0, 120,   160,    120,     0, -10.0,    50.0 },
00026     { "Press",    0,  60,   160,     60,     0,  -1.0,     5.0 },
00027     {        0,   0,   0,     0,      0,     0,   0.0,     0.0 }
00028 } ;
00029 
00030 void draw_chart_frame(edge_chart_type *p)
00031 {
00032     if (display) {
00033         display->fillrect(p->left+1, p->top+1,
00034         p->left + p->width - 2, p->top + p->height - 2, Black) ;
00035         display->rect(p->left, p->top, 
00036             p->left + p->width - 1,
00037             p->top + p->height -1, Blue) ;
00038         display->set_font((unsigned char*) Arial12x12);
00039         display->foreground(White) ;
00040         display->locate(p->left + 5, p->top + 5) ;
00041         display->printf(p->name) ;
00042     }
00043 }
00044 
00045 void   draw_all_chart_frame(void) 
00046 {
00047     edge_chart_type *p ;
00048     if (display) {
00049         reset_watch_dog() ;
00050         display->BusEnable(true) ;
00051         for(p = edge_chart ; p->name ; p++ ) {
00052             draw_chart_frame(p) ;
00053         }
00054         display->BusEnable(false) ;
00055     }
00056 }