   return;
 }
 
-uint8_t flash_read(uint8_t hilo, int addr) {
+uint8_t flash_read(uint8_t hilo, unsigned int addr) {
   return spi_transaction(0x20 + hilo * 8,
                          (addr >> 8) & 0xFF,
                          addr & 0xFF,


uint8_t write_flash_pages(int length) {
  int x = 0;
  int page = current_page(here);
  while (x < length) {
    if (page != current_page(here)) {
      commit(page);
      page = current_page(here);
    }
    flash(LOW, here, buff[x++]);
    flash(HIGH, here, buff[x++]);


static bool rst_active_high;

void reset_target(bool reset) {
  digitalWrite(RESET, ((reset && rst_active_high) || (!reset && !rst_active_high)) ? HIGH : LOW);
}

