Skip to content

Commit

Permalink
upgrade to 1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fredqian committed Sep 6, 2017
1 parent 1e0b79a commit 59798e1
Show file tree
Hide file tree
Showing 670 changed files with 222,115 additions and 2,580 deletions.
19 changes: 14 additions & 5 deletions lubot/hardware/lubot/avr/boards.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
LuBotMK.name=LuBot MK
LuBotMK.name=LuBotMK

LuBotMK.vid.0=0x2341
LuBotMK.pid.0=0x0043
LuBotMK.vid.1=0x2341
LuBotMK.pid.1=0x0001
LuBotMK.vid.2=0x2A03
LuBotMK.pid.2=0x0043
LuBotMK.vid.3=0x2341
LuBotMK.pid.3=0x0243

LuBotMK.upload.tool=avrdude
LuBotMK.upload.protocol=arduino
Expand All @@ -7,9 +16,9 @@ LuBotMK.upload.maximum_data_size=2048
LuBotMK.upload.speed=115200

LuBotMK.bootloader.tool=avrdude
LuBotMK.bootloader.low_fuses=0xff
LuBotMK.bootloader.high_fuses=0xde
LuBotMK.bootloader.extended_fuses=0x05
LuBotMK.bootloader.low_fuses=0xFF
LuBotMK.bootloader.high_fuses=0xDE
LuBotMK.bootloader.extended_fuses=0xFD
LuBotMK.bootloader.unlock_bits=0x3F
LuBotMK.bootloader.lock_bits=0x0F
LuBotMK.bootloader.file=optiboot/optiboot_atmega328.hex
Expand All @@ -18,5 +27,5 @@ LuBotMK.build.mcu=atmega328p
LuBotMK.build.f_cpu=16000000L
LuBotMK.build.board=AVR_UNO
LuBotMK.build.core=arduino
uno.build.variant=lubotmk
LuBotMK.build.variant=lubotmk
LuBotMK.build.variant=lubotmk
25 changes: 14 additions & 11 deletions lubot/hardware/lubot/avr/bootloaders/atmega/ATmegaBOOT_168.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
/* Tested with m168 */
/**********************************************************/

/* $Id$ */


/* some includes */
#include <inttypes.h>
Expand All @@ -75,7 +73,7 @@

/* the current avr-libc eeprom functions do not support the ATmega168 */
/* own eeprom write/read functions are used instead */
#if !defined(__AVR_ATmega168__) || !defined(__AVR_ATmega328P__)
#if !defined(__AVR_ATmega168__) || !defined(__AVR_ATmega328P__) || !defined(__AVR_ATmega328__)
#include <avr/eeprom.h>
#endif

Expand Down Expand Up @@ -204,6 +202,11 @@
#define SIG3 0x0F
#define PAGE_SIZE 0x40U //64 words

#elif defined __AVR_ATmega328__
#define SIG2 0x95
#define SIG3 0x14
#define PAGE_SIZE 0x40U //64 words

#elif defined __AVR_ATmega162__
#define SIG2 0x94
#define SIG3 0x04
Expand Down Expand Up @@ -369,7 +372,7 @@ int main(void)
UBRRHI = (F_CPU/(BAUD_RATE*16L)-1) >> 8;
UCSRA = 0x00;
UCSRB = _BV(TXEN)|_BV(RXEN);
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__)

#ifdef DOUBLE_SPEED
UCSR0A = (1<<U2X0); //Double speed mode USART0
Expand Down Expand Up @@ -558,7 +561,7 @@ int main(void)
if (flags.eeprom) { //Write to EEPROM one byte at a time
address.word <<= 1;
for(w=0;w<length.word;w++) {
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
while(EECR & (1<<EEPE));
EEAR = (uint16_t)(void *)address.word;
EEDR = buff[w];
Expand All @@ -580,7 +583,7 @@ int main(void)
/* if ((length.byte[0] & 0x01) == 0x01) length.word++; //Even up an odd number of bytes */
if ((length.byte[0] & 0x01)) length.word++; //Even up an odd number of bytes
cli(); //Disable interrupts, just to be sure
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__)
#if defined(EEPE)
while(bit_is_set(EECR,EEPE)); //Wait for previous EEPROM writes to complete
#else
while(bit_is_set(EECR,EEWE)); //Wait for previous EEPROM writes to complete
Expand Down Expand Up @@ -679,7 +682,7 @@ int main(void)
"rjmp write_page \n\t"
"block_done: \n\t"
"clr __zero_reg__ \n\t" //restore zero register
#if defined __AVR_ATmega168__ || __AVR_ATmega328P__ || __AVR_ATmega128__ || __AVR_ATmega1280__ || __AVR_ATmega1281__
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega128__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__)
: "=m" (SPMCSR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
#else
: "=m" (SPMCR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
Expand Down Expand Up @@ -712,7 +715,7 @@ int main(void)
putch(0x14);
for (w=0;w < length.word;w++) { // Can handle odd and even lengths okay
if (flags.eeprom) { // Byte access EEPROM read
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
while(EECR & (1<<EEPE));
EEAR = (uint16_t)(void *)address.word;
EECR |= (1<<EERE);
Expand Down Expand Up @@ -928,7 +931,7 @@ void putch(char ch)
while (!(UCSR1A & _BV(UDRE1)));
UDR1 = ch;
}
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__)
while (!(UCSR0A & _BV(UDRE0)));
UDR0 = ch;
#else
Expand Down Expand Up @@ -966,7 +969,7 @@ char getch(void)
return UDR1;
}
return 0;
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__)
uint32_t count = 0;
while(!(UCSR0A & _BV(RXC0))){
/* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
Expand Down Expand Up @@ -1003,7 +1006,7 @@ void getNch(uint8_t count)
while(!(UCSR1A & _BV(RXC1)));
UDR1;
}
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__)
getch();
#else
/* m8,16,32,169,8515,8535,163 */
Expand Down
28 changes: 21 additions & 7 deletions lubot/hardware/lubot/avr/bootloaders/atmega/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Makefile for ATmegaBOOT
# E.Lins, 18.7.2005
# $Id$
#
# Instructions
#
Expand Down Expand Up @@ -49,9 +48,9 @@ STK500-2 = $(STK500) -d$(MCU_TARGET) -ms -q -lCF -LCF -cUSB -I200kHz -s -wt


OBJ = $(PROGRAM).o
OPTIMIZE = -O2
OPTIMIZE = -Os

DEFS =
DEFS =
LIBS =

CC = avr-gcc
Expand Down Expand Up @@ -129,7 +128,7 @@ pro20_isp: isp

diecimila: TARGET = diecimila
diecimila: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1'
diecimila: AVR_FREQ = 16000000L
diecimila: AVR_FREQ = 16000000L
diecimila: $(PROGRAM)_diecimila.hex

diecimila_isp: diecimila
Expand All @@ -154,7 +153,7 @@ ng_isp: isp
atmega328: TARGET = atmega328
atmega328: MCU_TARGET = atmega328p
atmega328: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600
atmega328: AVR_FREQ = 16000000L
atmega328: AVR_FREQ = 16000000L
atmega328: LDSECTION = --section-start=.text=0x7800
atmega328: $(PROGRAM)_atmega328.hex

Expand All @@ -166,10 +165,25 @@ atmega328_isp: LFUSE = FF
atmega328_isp: EFUSE = 05
atmega328_isp: isp

atmega328_notp: TARGET = atmega328_notp
atmega328_notp: MCU_TARGET = atmega328
atmega328_notp: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600
atmega328_notp: AVR_FREQ = 16000000L
atmega328_notp: LDSECTION = --section-start=.text=0x7800
atmega328_notp: $(PROGRAM)_atmega328_notp.hex

atmega328_notp_isp: atmega328_notp
atmega328_notp_isp: TARGET = atmega328
atmega328_notp_isp: MCU_TARGET = atmega328
atmega328_notp_isp: HFUSE = DA
atmega328_notp_isp: LFUSE = FF
atmega328_notp_isp: EFUSE = 05
atmega328_notp_isp: isp

atmega328_pro8: TARGET = atmega328_pro_8MHz
atmega328_pro8: MCU_TARGET = atmega328p
atmega328_pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 -DDOUBLE_SPEED
atmega328_pro8: AVR_FREQ = 8000000L
atmega328_pro8: AVR_FREQ = 8000000L
atmega328_pro8: LDSECTION = --section-start=.text=0x7800
atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.hex

Expand All @@ -184,7 +198,7 @@ atmega328_pro8_isp: isp
mega: TARGET = atmega1280
mega: MCU_TARGET = atmega1280
mega: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=0' -DBAUD_RATE=57600
mega: AVR_FREQ = 16000000L
mega: AVR_FREQ = 16000000L
mega: LDSECTION = --section-start=.text=0x1F000
mega: $(PROGRAM)_atmega1280.hex

Expand Down
21 changes: 13 additions & 8 deletions lubot/hardware/lubot/avr/bootloaders/bt/ATmegaBOOT_168.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

/* the current avr-libc eeprom functions do not support the ATmega168 */
/* own eeprom write/read functions are used instead */
#if !defined(__AVR_ATmega168__) || !defined(__AVR_ATmega328P__)
#if !defined(__AVR_ATmega168__) || !defined(__AVR_ATmega328P__) || !defined(__AVR_ATmega328__)
#include <avr/eeprom.h>
#endif

Expand Down Expand Up @@ -194,6 +194,11 @@
#define SIG3 0x0F
#define PAGE_SIZE 0x40U //64 words

#elif defined __AVR_ATmega328__
#define SIG2 0x95
#define SIG3 0x14
#define PAGE_SIZE 0x40U //64 words

#elif defined __AVR_ATmega162__
#define SIG2 0x94
#define SIG3 0x04
Expand Down Expand Up @@ -335,7 +340,7 @@ int main(void)
UBRRHI = (F_CPU/(BAUD_RATE*16L)-1) >> 8;
UCSRA = 0x00;
UCSRB = _BV(TXEN)|_BV(RXEN);
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)

UBRR0H = ((F_CPU / 16 + BAUD_RATE / 2) / BAUD_RATE - 1) >> 8;
UBRR0L = ((F_CPU / 16 + BAUD_RATE / 2) / BAUD_RATE - 1);
Expand Down Expand Up @@ -557,7 +562,7 @@ putch(0x0D);
if (getch() == ' ') {
if (flags.eeprom) { //Write to EEPROM one byte at a time
for(w=0;w<length.word;w++) {
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
while(EECR & (1<<EEPE));
EEAR = (uint16_t)(void *)address.word;
EEDR = buff[w];
Expand Down Expand Up @@ -675,7 +680,7 @@ putch(0x0D);
"rjmp write_page \n\t"
"block_done: \n\t"
"clr __zero_reg__ \n\t" //restore zero register
#if defined __AVR_ATmega168__ || __AVR_ATmega328P__
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega_328__)
: "=m" (SPMCSR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
#else
: "=m" (SPMCR) : "M" (PAGE_SIZE) : "r0","r16","r17","r24","r25","r28","r29","r30","r31"
Expand Down Expand Up @@ -707,7 +712,7 @@ putch(0x0D);
putch(0x14);
for (w=0;w < length.word;w++) { // Can handle odd and even lengths okay
if (flags.eeprom) { // Byte access EEPROM read
#if defined __AVR_ATmega168__ || __AVR_ATmega328P__
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
while(EECR & (1<<EEPE));
EEAR = (uint16_t)(void *)address.word;
EECR |= (1<<EERE);
Expand Down Expand Up @@ -921,7 +926,7 @@ void putch(char ch)
while (!(UCSR1A & _BV(UDRE1)));
UDR1 = ch;
}
#elif defined (__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif defined (__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
while (!(UCSR0A & _BV(UDRE0)));
UDR0 = ch;
#else
Expand All @@ -944,7 +949,7 @@ char getch(void)
return UDR1;
}
return 0;
#elif defined (__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif defined (__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
uint32_t count = 0;
while(!(UCSR0A & _BV(RXC0))){
/* 20060803 DojoCorp:: Addon coming from the previous Bootloader*/
Expand Down Expand Up @@ -982,7 +987,7 @@ void getNch(uint8_t count)
while(!(UCSR1A & _BV(RXC1)));
UDR1;
}
#elif (defined __AVR_ATmega168__) || defined(__AVR_ATmega328P__)
#elif (defined __AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328__)
while(!(UCSR0A & _BV(RXC0)));
UDR0;
#else
Expand Down
1 change: 0 additions & 1 deletion lubot/hardware/lubot/avr/bootloaders/bt/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Makefile for ATmegaBOOT
# E.Lins, 18.7.2005
# $Id$
#
# Instructions
#
Expand Down
Loading

0 comments on commit 59798e1

Please sign in to comment.