 #include BOOT_LOADER
 };
 
-uint8_t check;
-
-enum {
-    ACK = 0x79,
-    NAK = 0x1F,
-};
-
+uint8_t check;  // this checksum will get updated on each call to sendByte()
+
+enum { ACK = 0x79, NAK = 0x1F };
+
+// boot request codes sent to the target, based on STM's USART protocol
 enum {
     GET_CMD = 0x00,
     GETID_CMD = 0x02,

    return chipType;
}

static void massErase () {
#if 1
    sendCmd(ERASE_CMD);

#endif
}

// main sketch logic
void setup () {
    Serial.begin(115200);
    Serial.print("[stm32f1init] ");
