|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|
Contains Routines to decode Intel HEX Files and to send them to the Sensor. More...

Macros | |
| #define | MAXBYTES 30 |
| Maximum number of Bytes per Line (including Address, Type and Byte Count) More... | |
| #define | MEMSIZE 0x800 |
| Maximum size of the Sensor Program. More... | |
Functions | |
| int8_t | BootldRead (uint16_t adr) |
| Reads one page of Sensor ROM via the Sensor Boot Loader. More... | |
| int8_t | BootldWrite (uint16_t adr) |
| Sends one Page to the Sensor Boot Loader. More... | |
| void | Delay1s () |
| Waits one Second. More... | |
| static int8_t | DoOneLine (void) |
| Parses one Line of an Intel HEX File. More... | |
| void | HexDump (uint16_t adr, void *ptr, uint8_t n) |
| Prints one line of Hexdump. More... | |
| static int | ProgramSensor (void) |
| Programs the Sensor Firmware with the Content of mem[]. More... | |
| static int8_t | ReadIntelHex (void) |
| Reads an Intel HEX File into Memory. More... | |
| int8_t | UpdateSensorFirmware (void) |
| Updates the Sensor Firmware. More... | |
| static int8_t | VerifySensor (void) |
| Verifies the Sensor Firmware against the Content of mem[]. More... | |
| int8_t | VerifySensorFirmware (void) |
| Verifies the Sensor Firmware against an Intel-Hex-File. More... | |
Variables | |
| static char | mem [MEMSIZE] |
Contains Routines to decode Intel HEX Files and to send them to the Sensor.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Since the boot loader timing is very strict (there must not be a pause of more than a second between two characters) and we have enough of RAM we decode the Intel Hex file into RAM and then start the programming sequence.
| #define MAXBYTES 30 |
Maximum number of Bytes per Line (including Address, Type and Byte Count)
| #define MEMSIZE 0x800 |
Maximum size of the Sensor Program.
| int8_t BootldRead | ( | uint16_t | adr | ) |
Reads one page of Sensor ROM via the Sensor Boot Loader.
The page is stored in bootLdPage[]
| adr | The start Address |
References blFlags, BOOTLDDATA, BOOTLDERROR, cksum0, putc0(), and putd0().
Referenced by VerifySensor().


| int8_t BootldWrite | ( | uint16_t | adr | ) |
Sends one Page to the Sensor Boot Loader.
| adr | The Start Address of the Page |
References blFlags, BOOTLDERROR, cksum0, mem, putc0(), putd0(), and tickCnt.
Referenced by ProgramSensor().


| void Delay1s | ( | ) |
Waits one Second.
References delay50ms().

|
static |
Parses one Line of an Intel HEX File.
References cmdline, hprintf_P(), MAXBYTES, mem, MEMSIZE, RECTYPE_DATA, RECTYPE_EOF, and RECTYPE_EXTSEG.
Referenced by ReadIntelHex().


| void HexDump | ( | uint16_t | adr, |
| void * | ptr, | ||
| uint8_t | n | ||
| ) |
Prints one line of Hexdump.
| adr | The Address to be displayed |
| ptr | A Pointer to the first Byte |
| n | The number of Bytes to dump |
References hprintf_P().
Referenced by VerifySensor().


|
static |
Programs the Sensor Firmware with the Content of mem[].
References blFlags, BootldWrite(), hprintf_P(), and MEMSIZE.
Referenced by UpdateSensorFirmware().


|
static |
Reads an Intel HEX File into Memory.
References AssertRTS(), CFLAG_CMDRECEIVED, cFlags, cmdline, DoOneLine(), hprintf_P(), mem, and MEMSIZE.
Referenced by UpdateSensorFirmware(), and VerifySensorFirmware().


| int8_t UpdateSensorFirmware | ( | void | ) |
Updates the Sensor Firmware.
References blFlags, BOOTLDHELLO, hprintf_P(), ProgramSensor(), putc0(), ReadIntelHex(), SensorPowerOff(), SensorPowerOn(), and VerifySensor().
Referenced by CmdUpdateSensorFirmware().


|
static |
Verifies the Sensor Firmware against the Content of mem[].
References bootLdPage, BootldRead(), HexDump(), hprintf_P(), mem, and MEMSIZE.
Referenced by UpdateSensorFirmware(), and VerifySensorFirmware().


| int8_t VerifySensorFirmware | ( | void | ) |
Verifies the Sensor Firmware against an Intel-Hex-File.
References blFlags, BOOTLDHELLO, hprintf_P(), putc0(), ReadIntelHex(), SensorPowerOff(), SensorPowerOn(), and VerifySensor().
Referenced by CmdVerifySensorFirmware().


|
static |
mem[] is big enough to hold the whole program memory of the sensor. This takes a lot of RAM but we have enough to maximize reliability. We can load the whole bunch to RAM first and securely transfer it to the sensor.
Referenced by BootldWrite(), DoOneLine(), ReadIntelHex(), and VerifySensor().
1.8.15