#include "devices.h"
#include "memory.h"
+#define VERSION "Swansea Hackspace PIC Bootloader v1"
+
#define BAUD_RATE 19200
#ifdef _WIN32
void usage(const char * name)
{
- loge("Usage: %s [-b baud] [-p port] [-i] [-v] {file.hex}\n", name);
- loge("-b baud Set baudrate (default: %d)\n", BAUD_RATE);
- loge("-p port Set serial port (default: %s)\n", PORT_NAME);
- loge("-i ID Only mode.\n");
- loge("-v Verify after write\n");
+ loge(VERSION);
+ loge("Usage: %s [-b baud] [-p port] [-i] [-v] {file.hex}", name);
+ loge("-b baud Set baudrate (default: %d)", BAUD_RATE);
+ loge("-p port Set serial port (default: %s)", PORT_NAME);
+ loge("-i ID Only mode.");
+ loge("-v Verify after write");
}
return 1;
}
print_memory(addr, again, dev->rowsize);
- for (int i=0; i<rowlen; i++) {
+ for (int i=0; i<dev->rowsize; i++) {
if (again[i] != buff[i]) {
loge("UpdateMem: Verify failed on block 0x%04X", addr);
return 1;
if (!idonly && optind >= argc) {
loge("Error: missing hexfile");
+ loge("");
+ usage(argv[0]);
return 1;
}