Skip to content
Permalink
Browse files

RAM footprint reduction

The JTAG2::body array was reduced in size to 450 bytes, so that total RAM usage is under 512 bytes.
This has no functional implications, since this array can be safely reduced to ~300 bytes, but allows the firmware to fit in smaller MCUs like the Atmega48.
  • Loading branch information...
ElTangas committed May 27, 2018
1 parent 8c96600 commit 237016cac1bb93b8de7462899b3d992b3e8d190e
Showing with 3 additions and 2 deletions.
  1. +1 −1 source/JTAG2.cpp
  2. +2 −1 source/JTAG2.h
@@ -24,7 +24,7 @@ uint8_t (& JTAG2::size_byte)[4] = (uint8_t (&)[4]) JTAG2::size;
uint16_t (& JTAG2::size_word)[2] = (uint16_t (&)[2]) JTAG2::size;


uint8_t JTAG2::body [512];
uint8_t JTAG2::body [MAX_BODY_SIZE];

// *** Baud rate lookup table for UBRR0 register ***
FLASH<uint16_t> baud_tbl[8] = {0x0340, 0x01A0, 0x00CF, 0x0067, 0x0033, 0x0022, 0x0010, 0x008A};
@@ -97,7 +97,8 @@ namespace JTAG2 {
extern uint8_t (& size_byte)[4];
extern uint16_t (& size_word)[2];
constexpr uint8_t TOKEN = 0x0E;
extern uint8_t body [512];
constexpr int MAX_BODY_SIZE = 450; // Note: should not be reduced to less than 300 bytes.
extern uint8_t body [MAX_BODY_SIZE];

// *** Signature response ***
extern FLASH<uint8_t> sgn_resp[29];

0 comments on commit 237016c

Please sign in to comment.
You can’t perform that action at this time.