Compare commits
No commits in common. "1d3988981854bc3dfc730d993309b63c3015639d" and "9119ee215bd1eeece7c4cc3076460469166c801c" have entirely different histories.
1d39889818
...
9119ee215b
10
butterfly.c
10
butterfly.c
|
@ -39,8 +39,6 @@
|
|||
#define SERIAL_BAUDRATE B115200
|
||||
#define SERIAL_TIMEOUT 1000
|
||||
|
||||
#define WRITE_SIZE_EEPROM 16
|
||||
|
||||
struct multiboot_ops butterfly_ops;
|
||||
|
||||
typedef struct bfly_privdata_s
|
||||
|
@ -108,7 +106,7 @@ static int bfly_optarg_cb(int val, const char *arg, void *privdata)
|
|||
}
|
||||
break;
|
||||
|
||||
case 'e': /* chip erase */
|
||||
case 'e': /* no verify after write */
|
||||
p_priv->chip_erase = 1;
|
||||
break;
|
||||
|
||||
|
@ -117,7 +115,6 @@ static int bfly_optarg_cb(int val, const char *arg, void *privdata)
|
|||
fprintf(stderr, "Usage: butterfly_prog [options]\n"
|
||||
" -a <address> - optional: twi address for twiboot bridge mode\n"
|
||||
" -d <device> - selects butterfly serial device\n"
|
||||
" -e - executes a chip erase\n"
|
||||
" -r <flash|eeprom>:<file> - reads flash/eeprom to file (.bin | .hex | -)\n"
|
||||
" -w <flash|eeprom>:<file> - write flash/eeprom from file (.bin | .hex)\n"
|
||||
" -n - disable verify after write\n"
|
||||
|
@ -691,10 +688,7 @@ static int butterfly_write(struct multiboot * p_mboot,
|
|||
{
|
||||
p_mboot->progress_cb(p_progress_msg, pos, p_dbuf->length);
|
||||
|
||||
uint16_t len = (memtype == 'F') ? p_priv->buffersize : WRITE_SIZE_EEPROM;
|
||||
|
||||
len = MIN(len, p_dbuf->length - pos);
|
||||
|
||||
uint16_t len = MIN(p_priv->buffersize, p_dbuf->length - pos);
|
||||
if (butterfly_write_data(p_priv, p_dbuf->data + pos, len, memtype))
|
||||
{
|
||||
p_mboot->progress_cb(p_progress_msg, -1, -1);
|
||||
|
|
|
@ -457,12 +457,6 @@ static int hexfile_write(const char *filename, struct databuf *dbuf)
|
|||
}
|
||||
}
|
||||
|
||||
if (addr_min >= addr_max)
|
||||
{
|
||||
addr_min = 0;
|
||||
addr_max = dbuf->length;
|
||||
}
|
||||
|
||||
addr_min = addr_min & ~0x0F;
|
||||
addr_max = (addr_max + 0x0F) & ~0x0F;
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ static void progress_mode0_cb(const char *msg, int pos, int size)
|
|||
* ************************************************************************* */
|
||||
static void progress_mode1_cb(const char *msg, int pos, int size)
|
||||
{
|
||||
if (pos != -1 && size > 0)
|
||||
if (pos != -1 && size != -1)
|
||||
{
|
||||
char stars[51];
|
||||
int i;
|
||||
|
@ -111,7 +111,7 @@ static void progress_mode2_cb(const char *msg, int pos, int size)
|
|||
{
|
||||
static int old_count;
|
||||
|
||||
if (pos != -1 && size > 0)
|
||||
if (pos != -1 && size != -1)
|
||||
{
|
||||
if (pos == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue