Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit eb7a8c2

Browse files
Improve comments in image.cpp
1 parent 678c79d commit eb7a8c2

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

images.cpp

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
#include "optiLoader.h"
22

33
const image_t PROGMEM image_328 = {
4+
// Sketch name, only used for serial printing
45
{"optiboot_atmega328.hex"},
6+
// Chip name, only used for serial printing
57
{"atmega328P"},
6-
0x950F, /* Signature bytes for 328P */
7-
{0x3F, 0xFF, 0xDE, 0x05}, // pre program fuses (prot/lock, low, high, ext)
8-
{0x0F, 0x0, 0x0, 0x0}, // post program fuses
9-
{0x3F, 0xFF, 0xFF, 0x07}, // fuse mask
10-
32768, // size of chip flash in bytes
11-
128, // size in bytes of flash page
8+
// Signature bytes for 328P
9+
0x950F,
10+
// Programming fuses, written before writing to flash. Fuses set to
11+
// zero are untouched.
12+
{0x3F, 0xFF, 0xDE, 0x05}, // {lock, low, high, extended}
13+
// Normal fuses, written after writing to flash (but before
14+
// verifying). Fuses set to zero are untouched.
15+
{0x0F, 0x0, 0x0, 0x0}, // {lock, low, high, extended}
16+
// Fuse verify mask. Any bits set to zero in these values are
17+
// ignored while verifying the fuses after writing them. All (and
18+
// only) bits that are unused for this atmega chip should be zero
19+
// here.
20+
{0x3F, 0xFF, 0xFF, 0x07}, // {lock, low, high, extended}
21+
// size of chip flash in bytes
22+
32768,
23+
// size in bytes of flash page
24+
128,
25+
// The actual image to flash. This can be copy-pasted as-is from a
26+
// .hex file. If you do, replace all lines below starting with a
27+
// colon, but make sure to keep the start and end markers {R"( and
28+
// )"} in place.
1229
{R"(
1330
:107E0000112494B714BE892F8D7011F0892FDED004
1431
:107E100085E08093810082E08093C00088E18093B8
@@ -46,8 +63,9 @@ const image_t PROGMEM image_328 = {
4663

4764

4865
/*
49-
* Table of defined images
50-
*/
66+
* Table of defined images. The first one matching the chip's signature
67+
* is used.
68+
*/
5169
const image_t *images[] = {
5270
&image_328,
5371
};

0 commit comments

Comments
 (0)