Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
base/firmware/web-firmware-ajax.c@158:80441390de93, 2021-02-01 (annotated)
- Committer:
- andrewboyson
- Date:
- Mon Feb 01 19:33:21 2021 +0000
- Revision:
- 158:80441390de93
- Parent:
- 110:8ab752842d25
Modified firmware module to disable the restart button until the file upload had completed successfully.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 103:91194cc19bbb | 1 | #include <stdio.h> |
andrewboyson | 103:91194cc19bbb | 2 | |
andrewboyson | 103:91194cc19bbb | 3 | #include "http.h" |
andrewboyson | 103:91194cc19bbb | 4 | #include "firmware.h" |
andrewboyson | 103:91194cc19bbb | 5 | #include "web-firmware.h" |
andrewboyson | 103:91194cc19bbb | 6 | |
andrewboyson | 103:91194cc19bbb | 7 | void WebFirmwareAjax() |
andrewboyson | 103:91194cc19bbb | 8 | { |
andrewboyson | 103:91194cc19bbb | 9 | //Header |
andrewboyson | 103:91194cc19bbb | 10 | HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL); |
andrewboyson | 103:91194cc19bbb | 11 | |
andrewboyson | 103:91194cc19bbb | 12 | //Upload status |
andrewboyson | 158:80441390de93 | 13 | if (FirmwareSentLength != FirmwareFileLength) |
andrewboyson | 103:91194cc19bbb | 14 | { |
andrewboyson | 103:91194cc19bbb | 15 | HttpAddText("Length error\r\n"); |
andrewboyson | 103:91194cc19bbb | 16 | HttpAddF (" sent %6d\r\n", FirmwareSentLength); |
andrewboyson | 103:91194cc19bbb | 17 | HttpAddF (" rcvd %6d\r\n", FirmwareRcvdLength); |
andrewboyson | 103:91194cc19bbb | 18 | HttpAddF (" file %6d\r\n", FirmwareFileLength); |
andrewboyson | 103:91194cc19bbb | 19 | } |
andrewboyson | 103:91194cc19bbb | 20 | |
andrewboyson | 103:91194cc19bbb | 21 | //Save status |
andrewboyson | 103:91194cc19bbb | 22 | if (FirmwareFailed) |
andrewboyson | 103:91194cc19bbb | 23 | { |
andrewboyson | 103:91194cc19bbb | 24 | HttpAddText("Save failed - see log"); |
andrewboyson | 103:91194cc19bbb | 25 | } |
andrewboyson | 103:91194cc19bbb | 26 | else |
andrewboyson | 103:91194cc19bbb | 27 | { |
andrewboyson | 158:80441390de93 | 28 | HttpAddF("Saved %d bytes", FirmwareFileLength); |
andrewboyson | 103:91194cc19bbb | 29 | } |
andrewboyson | 103:91194cc19bbb | 30 | |
andrewboyson | 103:91194cc19bbb | 31 | //Delimiter |
andrewboyson | 103:91194cc19bbb | 32 | HttpAddChar('\f'); |
andrewboyson | 103:91194cc19bbb | 33 | |
andrewboyson | 103:91194cc19bbb | 34 | //New directory list |
andrewboyson | 103:91194cc19bbb | 35 | WebFirmwareListSemihostFiles(); |
andrewboyson | 103:91194cc19bbb | 36 | } |