diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-12-05 18:56:18 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-12-05 18:56:18 +0300 |
commit | 1dd02de842da6ab17cac2b621f40bc1a09e4b455 (patch) | |
tree | 43972445648e46ad06965f4c18d4ac2a0bdcefac /src/bossa | |
parent | 4e5922df259a74f9010c37f69e94f0fac8677763 (diff) |
Save RAM by declaring data in Bossa const where possible
Diffstat (limited to 'src/bossa')
-rw-r--r-- | src/bossa/Applet.cpp | 2 | ||||
-rw-r--r-- | src/bossa/Applet.h | 2 | ||||
-rw-r--r-- | src/bossa/WordCopyApplet.h | 2 | ||||
-rw-r--r-- | src/bossa/WordCopyArm.cpp | 42 |
4 files changed, 26 insertions, 22 deletions
diff --git a/src/bossa/Applet.cpp b/src/bossa/Applet.cpp index 00eb3588..0b7b8cb2 100644 --- a/src/bossa/Applet.cpp +++ b/src/bossa/Applet.cpp @@ -30,7 +30,7 @@ Applet::Applet(Samba& samba, uint32_t addr, - uint8_t* code, + const uint8_t* code, uint32_t size, uint32_t start, uint32_t stack, diff --git a/src/bossa/Applet.h b/src/bossa/Applet.h index 3a8dc3f0..60305c6f 100644 --- a/src/bossa/Applet.h +++ b/src/bossa/Applet.h @@ -38,7 +38,7 @@ class Applet public: Applet(Samba& samba, uint32_t addr, - uint8_t* code, + const uint8_t* code, uint32_t size, uint32_t start, uint32_t stack, diff --git a/src/bossa/WordCopyApplet.h b/src/bossa/WordCopyApplet.h index 2be5e3a7..d04c60be 100644 --- a/src/bossa/WordCopyApplet.h +++ b/src/bossa/WordCopyApplet.h @@ -43,7 +43,7 @@ public: void setWords(uint32_t words) THROWS(GCodeException); private: - static WordCopyArm applet; + static const WordCopyArm applet; }; #endif // _WORDCOPYAPPLET_H diff --git a/src/bossa/WordCopyArm.cpp b/src/bossa/WordCopyArm.cpp index 09bb1175..5a581078 100644 --- a/src/bossa/WordCopyArm.cpp +++ b/src/bossa/WordCopyArm.cpp @@ -2,24 +2,28 @@ #include "WordCopyArm.h" #include "WordCopyApplet.h" -WordCopyArm WordCopyApplet::applet = { -// dst_addr -0x00000028, -// reset -0x00000024, -// src_addr -0x0000002c, -// stack -0x00000020, -// start -0x00000000, -// words -0x00000030, -// code +const WordCopyArm WordCopyApplet::applet = { -0x09, 0x48, 0x0a, 0x49, 0x0a, 0x4a, 0x02, 0xe0, 0x08, 0xc9, 0x08, 0xc0, 0x01, 0x3a, 0x00, 0x2a, -0xfa, 0xd1, 0x04, 0x48, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x48, 0x85, 0x46, 0x70, 0x47, 0xc0, 0x46, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, -} + // dst_addr + 0x00000028, + // reset + 0x00000024, + // src_addr + 0x0000002c, + // stack + 0x00000020, + // start + 0x00000000, + // words + 0x00000030, + // code + { + 0x09, 0x48, 0x0a, 0x49, 0x0a, 0x4a, 0x02, 0xe0, 0x08, 0xc9, 0x08, 0xc0, 0x01, 0x3a, 0x00, 0x2a, + 0xfa, 0xd1, 0x04, 0x48, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x48, 0x85, 0x46, 0x70, 0x47, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + } }; + +// End + |