|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|


Go to the source code of this file.
Data Structures | |
| struct | ftestPortsStruct |
| Holds the test declarations for one Port. More... | |
Functions | |
| bool | FTest (void) |
| Performs a simple Factory Test. More... | |
| void | FTest485 (void) |
| Performs a Factory Test of the RS485-Lines. More... | |
| bool FTest | ( | void | ) |
Performs a simple Factory Test.
This routine tries to test everything that can be tested without user intervention. It cannot detect all possible error conditions but will detect a lot of possible short circuits and other errors and can give valuable hints to the test personal.
All special function pins must be set to normal port I/O. The testMask basically is a copy of the DDR since only output pins can be tested. Take care of pins that must keep their special function during the test (e.g. TxD of the USART that receives the result). This has also to be masked out, as well as pins that would cause disastrous consequences if switched uncontrolled.
First the user is asked to press the pushbutton key. This is to test the key itself. After that, the signal outputs are toggled a few times each. LEDs connected on the test adapter will show the user if that works. The following tests require no user attention. The device will measure its supply voltages and test all output pins against all others so short circuits between output pins or output pin and VCC/GND will most likely be detected.
Since interrupts are disabled in the progress of this function and DDRs are modified, the calling routine should perform a watchdog reset to restore proper operation of the device.
Do not try to restore DDRs and interrupts, you will most likely forget some and there is nothing bad in willingly performing a reset...
References delay1s(), FTestSupply(), FTestSWUnreg(), FTestToggleSignal(), FTestWalkingOne(), FTestWalkingZero(), hprintf_P(), LEDBlueOff(), LEDBlueOn(), LEDGreenOff(), LEDGreenOn(), LEDRedOff(), LEDRedOn(), LEDYellowOff(), LEDYellowOn(), SensorPowerOff(), and WaitKeyBlinking().
Referenced by CmdFTest().


| void FTest485 | ( | void | ) |
Performs a Factory Test of the RS485-Lines.
For this test to succeed, all jumpers on X3 have to be in position "485" and a switch has to be in the test adapter that connects sensor RS485 with host RS485.
References delay10ms(), FTest485GetConnects(), LCDPrintLine_P(), and secCnt.

1.8.15