diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/storage.cc | 2 | ||||
-rw-r--r-- | src/system.cc | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/storage.cc b/src/storage.cc index 6a85e22..042b778 100644 --- a/src/storage.cc +++ b/src/storage.cc @@ -253,7 +253,7 @@ void Storage::load(uint8_t idx, uint8_t *data) i2c_read(0, 1 + idx, 1, &page_offset); i2c_read(1 + (page_offset / 8), (page_offset % 8) * 32, 2, header); - i2c_read(1 + (page_offset / 8), (page_offset % 8) * 32, header[1] + 2, data); + i2c_read(1 + (page_offset / 8), (page_offset % 8) * 32, header[1] + 4, data); } void Storage::save(uint8_t *data) diff --git a/src/system.cc b/src/system.cc index f472b05..e829e72 100644 --- a/src/system.cc +++ b/src/system.cc @@ -16,7 +16,7 @@ System rocket; animation_t active_anim; uint8_t disp_buf[260]; // 4 byte header + 256 byte data -uint8_t *rx_buf = disp_buf + sizeof(disp_buf) - 32; +uint8_t *rx_buf = disp_buf + sizeof(disp_buf) - 33; void System::initialize() { @@ -93,7 +93,7 @@ void System::loadPattern(uint8_t anim_no) storage.load(anim_no, disp_buf); active_anim.type = (AnimationType)(disp_buf[0] >> 4); - active_anim.length = disp_buf[1] - 2; + active_anim.length = disp_buf[1]; if (active_anim.type == AnimationType::TEXT) { active_anim.speed = (disp_buf[2] & 0xf0) + 15; @@ -124,12 +124,12 @@ void System::receive(void) * in the RxExpect enum declaration) */ if (rxExpect > PATTERN2) { - rx_buf[rx_pos++] = modem.buffer_get(); + rx_buf[rx_pos++] = rx_byte; /* - * The HEADER sets the pattern length and is not included in the - * calculation -> only count bytes for META and DATA. + * HEADER and META are not included in the length + * -> only count bytes for DATA. */ - if (rxExpect > HEADER2) { + if (rxExpect > META2) { remaining_bytes--; } } |