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.
Dependencies: EthernetInterfacePlusHostname RdWebServer mbed-rtos mbed
DrawingManager.cpp@1:362331cec9b7, 2015-08-20 (annotated)
- Committer:
- Bobty
- Date:
- Thu Aug 20 07:41:02 2015 +0000
- Revision:
- 1:362331cec9b7
- Child:
- 2:99eb4c6e9ea4
Implemented a command protocol using HTTP POST
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Bobty | 1:362331cec9b7 | 1 | // |
| Bobty | 1:362331cec9b7 | 2 | // Drawing Manager for Pancake Drawbot |
| Bobty | 1:362331cec9b7 | 3 | // Rob Dobson 2015 |
| Bobty | 1:362331cec9b7 | 4 | // |
| Bobty | 1:362331cec9b7 | 5 | |
| Bobty | 1:362331cec9b7 | 6 | #include "DrawingManager.h" |
| Bobty | 1:362331cec9b7 | 7 | #include "rtos.h" |
| Bobty | 1:362331cec9b7 | 8 | |
| Bobty | 1:362331cec9b7 | 9 | DrawingManager::DrawingManager(int numLeds, int splitPoint) |
| Bobty | 1:362331cec9b7 | 10 | { |
| Bobty | 1:362331cec9b7 | 11 | pLedStrip = new ledstrip(numLeds, splitPoint); |
| Bobty | 1:362331cec9b7 | 12 | isBusy = false; |
| Bobty | 1:362331cec9b7 | 13 | } |
| Bobty | 1:362331cec9b7 | 14 | |
| Bobty | 1:362331cec9b7 | 15 | void DrawingManager::init() |
| Bobty | 1:362331cec9b7 | 16 | { |
| Bobty | 1:362331cec9b7 | 17 | } |
| Bobty | 1:362331cec9b7 | 18 | |
| Bobty | 1:362331cec9b7 | 19 | char* DrawingManager::start(const unsigned char* cmdBuf, int cmdLen) |
| Bobty | 1:362331cec9b7 | 20 | { |
| Bobty | 1:362331cec9b7 | 21 | if (isBusy) |
| Bobty | 1:362331cec9b7 | 22 | return "BUSY"; |
| Bobty | 1:362331cec9b7 | 23 | isBusy = true; |
| Bobty | 1:362331cec9b7 | 24 | char* respStr = cmdmsg::Interpret(cmdBuf, cmdLen, pLedStrip); |
| Bobty | 1:362331cec9b7 | 25 | pLedStrip->ShowLeds(); |
| Bobty | 1:362331cec9b7 | 26 | isBusy = false; |
| Bobty | 1:362331cec9b7 | 27 | return respStr; |
| Bobty | 1:362331cec9b7 | 28 | } |
| Bobty | 1:362331cec9b7 | 29 | |
| Bobty | 1:362331cec9b7 | 30 | void DrawingManager::service() |
| Bobty | 1:362331cec9b7 | 31 | { |
| Bobty | 1:362331cec9b7 | 32 | } |