Skip to content

Commit

Permalink
Merge pull request #1520 from stefanrueger/prodsig-isp
Browse files Browse the repository at this point in the history
Enable prodsig read for stk500v2 based programmers
  • Loading branch information
stefanrueger authored Oct 17, 2023
2 parents cbac634 + 61daaa3 commit 8f2fcf6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/stk500v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2326,6 +2326,11 @@ static int stk500hv_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AVR
buf[0] = mode == PPMODE? CMD_READ_OSCCAL_PP: CMD_READ_OSCCAL_HVSP;
} else if (str_eq(mem->desc, "signature")) {
buf[0] = mode == PPMODE? CMD_READ_SIGNATURE_PP: CMD_READ_SIGNATURE_HVSP;
} else if (str_eq(mem->desc, "prodsig")) {
buf[0] = addr&1?
(mode == PPMODE? CMD_READ_OSCCAL_PP: CMD_READ_OSCCAL_HVSP):
(mode == PPMODE? CMD_READ_SIGNATURE_PP: CMD_READ_SIGNATURE_HVSP);
addr /= 2;
}

/*
Expand Down Expand Up @@ -2455,8 +2460,11 @@ static int stk500isp_read_byte(const PROGRAMMER *pgm, const AVRPART *p, const AV
buf[0] = CMD_READ_OSCCAL_ISP;
} else if (str_eq(mem->desc, "signature")) {
buf[0] = CMD_READ_SIGNATURE_ISP;
} else if (str_eq(mem->desc, "prodsig")) {
buf[0] = addr&1? CMD_READ_OSCCAL_ISP: CMD_READ_SIGNATURE_ISP;
}


if ((op = mem->op[AVR_OP_READ]) == NULL) {
pmsg_error("invalid operation AVR_OP_READ on %s memory\n", mem->desc);
return -1;
Expand Down

0 comments on commit 8f2fcf6

Please sign in to comment.