blob: 59d97b5df795fc75a1b42cf3726a3e7daf371d0f [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#ifndef AOS_CRIO_DRIVER_STATION_DISPLAY_H_
2#define AOS_CRIO_DRIVER_STATION_DISPLAY_H_
3
4#include <stdarg.h>
5
6#include "WPILib/DriverStationLCD.h"
7
8namespace aos {
9
10class DriverStationDisplay {
11 public:
12 static void Send(int line, const char *fmt, ...)
13 __attribute__((format(printf, 2, 3))) {
14 DriverStationLCD::Line ds_line;
15 switch (line) {
16 case 0:
17 ds_line = DriverStationLCD::kMain_Line6;
18 break;
19 case 1:
20 ds_line = DriverStationLCD::kUser_Line1;
21 break;
22 case 2:
23 ds_line = DriverStationLCD::kUser_Line2;
24 break;
25 case 3:
26 ds_line = DriverStationLCD::kUser_Line3;
27 break;
28 case 4:
29 ds_line = DriverStationLCD::kUser_Line4;
30 break;
31 case 5:
32 ds_line = DriverStationLCD::kUser_Line5;
33 break;
34 case 6:
35 ds_line = DriverStationLCD::kUser_Line6;
36 break;
37 default:
38 printf("illegal line number %hhd\n", line);
39 return;
40 }
41 va_list args;
42 va_start(args, fmt);
43 DriverStationLCD::GetInstance()->VPrintfLine(ds_line, fmt, args);
44 va_end(args);
45 DriverStationLCD::GetInstance()->UpdateLCD();
46 }
47};
48
49} // namespace aos
50
51#endif