IPS(Interpreter for Process Structures) for mbed
Dependencies: ConfigFile FATFileSystem mbed
IPS port from linux/unix version.
mbed_blinky.ips
0 VAR led1 " LED1 " DigitalOut led1 ! : main ANFANG 1 JA? 1 led1 @ write 200 wait_ms 0 led1 @ write 200 wait_ms DANN/NOCHMAL ; main
- ips-02.tgz - ips for linux/unix
- ipsdoc.zip - document
- https://bitbucket.org/va009039/ips/
VideoRAM.h@1:e74530ad6b9e, 2015-05-13 (annotated)
- Committer:
- va009039
- Date:
- Wed May 13 18:39:01 2015 +0900
- Revision:
- 1:e74530ad6b9e
- Child:
- 2:908338b1151a
add L152RE.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
va009039 |
1:e74530ad6b9e | 1 | #pragma once |
va009039 |
1:e74530ad6b9e | 2 | |
va009039 |
1:e74530ad6b9e | 3 | class VideoRAM { |
va009039 |
1:e74530ad6b9e | 4 | public: |
va009039 |
1:e74530ad6b9e | 5 | VideoRAM(RawSerial& pc):_pc(pc),x(0),y(0) { |
va009039 |
1:e74530ad6b9e | 6 | _puts("\x1b[2J"); // erase |
va009039 |
1:e74530ad6b9e | 7 | } |
va009039 |
1:e74530ad6b9e | 8 | void vpoke(uint16_t i, uint8_t b) { |
va009039 |
1:e74530ad6b9e | 9 | if (i < 1024) { |
va009039 |
1:e74530ad6b9e | 10 | if (x != i%64 || y != i/64) { |
va009039 |
1:e74530ad6b9e | 11 | x = i%64; |
va009039 |
1:e74530ad6b9e | 12 | y = i/64; |
va009039 |
1:e74530ad6b9e | 13 | char buf[16]; |
va009039 |
1:e74530ad6b9e | 14 | snprintf(buf, sizeof(buf), "\x1b[%d;%dH", y+1, x+1) ; // locate |
va009039 |
1:e74530ad6b9e | 15 | _puts(buf); |
va009039 |
1:e74530ad6b9e | 16 | } |
va009039 |
1:e74530ad6b9e | 17 | _putc(b & 0x7f); |
va009039 |
1:e74530ad6b9e | 18 | x++; |
va009039 |
1:e74530ad6b9e | 19 | } |
va009039 |
1:e74530ad6b9e | 20 | } |
va009039 |
1:e74530ad6b9e | 21 | |
va009039 |
1:e74530ad6b9e | 22 | private: |
va009039 |
1:e74530ad6b9e | 23 | void _puts(const char* s) { |
va009039 |
1:e74530ad6b9e | 24 | while(*s) { |
va009039 |
1:e74530ad6b9e | 25 | _putc(*s++); |
va009039 |
1:e74530ad6b9e | 26 | } |
va009039 |
1:e74530ad6b9e | 27 | } |
va009039 |
1:e74530ad6b9e | 28 | void _putc(int c) { |
va009039 |
1:e74530ad6b9e | 29 | _pc.putc(c); |
va009039 |
1:e74530ad6b9e | 30 | } |
va009039 |
1:e74530ad6b9e | 31 | RawSerial& _pc; |
va009039 |
1:e74530ad6b9e | 32 | uint16_t x, y; |
va009039 |
1:e74530ad6b9e | 33 | }; |
va009039 |
1:e74530ad6b9e | 34 |