This package contains a simple test of tests for various elements of the SmartBoard hardware, which is a simple baseboard designed for easy embedding. It is able to run both a semi-automatic test suite as well as allow interactive testing.
Dependencies: EthernetNetIf NTPClient_NetServices mbed
This program is most of what you need to test your SmartBoard baseboard hardware. It provides a means to test the following:
- Two channels of CAN (with a loopback cable)
- RS-232 Ports
- Analog inputs
- PWM outputs
- Ethernet port
- Real time clock
- micro SD
- USB Host port
ShowTime.c@0:5db287f0060b, 2011-01-16 (annotated)
- Committer:
- WiredHome
- Date:
- Sun Jan 16 18:30:14 2011 +0000
- Revision:
- 0:5db287f0060b
- Child:
- 1:586392c0e935
First release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WiredHome | 0:5db287f0060b | 1 | |
WiredHome | 0:5db287f0060b | 2 | #include "mbed.h" |
WiredHome | 0:5db287f0060b | 3 | |
WiredHome | 0:5db287f0060b | 4 | |
WiredHome | 0:5db287f0060b | 5 | static int SignOf(const int i) { |
WiredHome | 0:5db287f0060b | 6 | return (i >= 0) ? 1 : -1; |
WiredHome | 0:5db287f0060b | 7 | } |
WiredHome | 0:5db287f0060b | 8 | |
WiredHome | 0:5db287f0060b | 9 | |
WiredHome | 0:5db287f0060b | 10 | void ShowTime(time_t tValue=0, int hOffset=0, int mOffset=0) { |
WiredHome | 0:5db287f0060b | 11 | time_t ctTime; |
WiredHome | 0:5db287f0060b | 12 | char timbuf[70]; |
WiredHome | 0:5db287f0060b | 13 | |
WiredHome | 0:5db287f0060b | 14 | if (tValue == 0) |
WiredHome | 0:5db287f0060b | 15 | tValue = time(NULL); |
WiredHome | 0:5db287f0060b | 16 | ctTime = tValue + hOffset * 3600 + SignOf(hOffset) * mOffset * 60; |
WiredHome | 0:5db287f0060b | 17 | strcpy(timbuf, ctime(&ctTime)); |
WiredHome | 0:5db287f0060b | 18 | timbuf[strlen(timbuf)-1] = '\0'; |
WiredHome | 0:5db287f0060b | 19 | printf(" %s (offset: %02i:%02i)\r\n", timbuf, hOffset, mOffset); |
WiredHome | 0:5db287f0060b | 20 | } |