From a047db1259d3822b554d300ecc48fb2052bfc849 Mon Sep 17 00:00:00 2001 From: Attila Veghelyi Date: Mon, 9 Jun 2025 17:25:22 +0200 Subject: Follow version 0.12.4 --- fileIO.c | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'fileIO.c') diff --git a/fileIO.c b/fileIO.c index 30da4b0..8ac79ca 100644 --- a/fileIO.c +++ b/fileIO.c @@ -1,6 +1,6 @@ /* * fileIO.c - file read and write - * Copyright (C) 2010-2021 Alberto Maccioni + * Copyright (C) 2010-2025 Alberto Maccioni * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include "progP18.h" #include "progP24.h" #include "progAVR.h" +#include "deviceRW.h" unsigned int htoi(const char *hex, int length) { @@ -40,14 +41,14 @@ unsigned int htoi(const char *hex, int length) return v; } -void Save(char* dev,char* savefile) +void Save(int devType,char* savefile) { FILE* f=fopen(savefile,"w"); if(!f) return; char str[512],str1[512]=""; int i,sum=0,count=0,ext=0,s,base; //**************** 10-16F ******************************************* - if(!strncmp(dev,"10",2)||!strncmp(dev,"12",2)||!strncmp(dev,"16",2)){ + if(devType==PIC12||devType==PIC16){ int x=0x3fff,addr; //if(!strncmp(dev,"16",2)||!strncmp(dev,"12F6",4)) x=0x3fff; fprintf(f,":020000040000FA\n"); //extended address=0 @@ -102,7 +103,7 @@ void Save(char* dev,char* savefile) fprintf(f,":00000001FF\n"); } //**************** 18F ******************************************* - else if(!strncmp(dev,"18F",3)){ + else if(devType==PIC18){ fprintf(f,":020000040000FA\n"); //extended address=0 for(i=0;i