Compare commits
No commits in common. "master" and "devel" have entirely different histories.
10
README.md
10
README.md
@ -10,11 +10,11 @@ Currently the following AVR MCUs are supported:
|
|||||||
|
|
||||||
AVR MCU | Flash bytes used (.text + .data) | Bootloader region size
|
AVR MCU | Flash bytes used (.text + .data) | Bootloader region size
|
||||||
--- | --- | ---
|
--- | --- | ---
|
||||||
attiny85 | 954 (0x3BA) | 512 words
|
attiny85 | 956 (0x3BC) | 512 words
|
||||||
atmega8 | 786 (0x312) | 512 words
|
atmega8 | 802 (0x322) | 512 words
|
||||||
atmega88 | 810 (0x32A) | 512 words
|
atmega88 | 826 (0x33A) | 512 words
|
||||||
atmega168 | 810 (0x32A) | 512 words
|
atmega168 | 826 (0x33A) | 512 words
|
||||||
atmega328p | 810 (0x32A) | 512 words
|
atmega328p | 826 (0x33A) | 512 words
|
||||||
|
|
||||||
(Compiled on Ubuntu 18.04 LTS (gcc 5.4.0 / avr-libc 2.0.0) with EEPROM and LED support)
|
(Compiled on Ubuntu 18.04 LTS (gcc 5.4.0 / avr-libc 2.0.0) with EEPROM and LED support)
|
||||||
|
|
||||||
|
24
main.c
24
main.c
@ -21,7 +21,7 @@
|
|||||||
#include <avr/boot.h>
|
#include <avr/boot.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
#define VERSION_STRING "TWIBOOT v3.2"
|
#define VERSION_STRING "TWIBOOT v3.1"
|
||||||
#define EEPROM_SUPPORT 1
|
#define EEPROM_SUPPORT 1
|
||||||
#define LED_SUPPORT 1
|
#define LED_SUPPORT 1
|
||||||
|
|
||||||
@ -400,19 +400,21 @@ static uint8_t TWI_data_write(uint8_t bcnt, uint8_t data)
|
|||||||
uint8_t pos = bcnt -4;
|
uint8_t pos = bcnt -4;
|
||||||
|
|
||||||
buf[pos] = data;
|
buf[pos] = data;
|
||||||
if (pos >= (SPM_PAGESIZE -1))
|
if (pos >= (sizeof(buf) -2))
|
||||||
{
|
{
|
||||||
if (cmd == CMD_ACCESS_FLASH)
|
|
||||||
{
|
|
||||||
#if (USE_CLOCKSTRETCH)
|
|
||||||
write_flash_page();
|
|
||||||
#else
|
|
||||||
cmd = CMD_WRITE_FLASH_PAGE;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
ack = 0x00;
|
ack = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((cmd == CMD_ACCESS_FLASH) &&
|
||||||
|
(pos >= (sizeof(buf) -1))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
#if (USE_CLOCKSTRETCH)
|
||||||
|
write_flash_page();
|
||||||
|
#else
|
||||||
|
cmd = CMD_WRITE_FLASH_PAGE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user