Skip to content

Commit 4ae45bd

Browse files
committed
v0.2.1 with FlashStringHelper
1 parent 3806e06 commit 4ae45bd

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

avr/boards.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ picocore.upload.using=avrdude
88
picocore.bootloader.unlock_bits=0x3f
99
picocore.bootloader.lock_bits=0x3e
1010
picocore.build.core=picocore
11+
# board name will be used for macro define
1112
picocore.build.board=attiny
1213
# build flags are for compile only, not link
1314
#picocore.build.extra_flags={build.timing}
1415

15-
#picocore.upload.maximum_data_size=64
16+
#picocore.upload.maximum_size=1024
1617
#picocore.build.mcu_compile=attiny13a
18+
#picocore.build.mcu=attiny13a
1719
#picocore.build.variant=attiny13
1820

1921
# default clock = 8Mhz
@@ -23,6 +25,7 @@ menu.mcu=MCU
2325

2426
picocore.menu.mcu.t13=ATtiny13
2527
picocore.menu.mcu.t13.build.mcu=attiny13
28+
#picocore.menu.mcu.t13.build.variant=attiny13
2629
picocore.menu.mcu.t13.build.f_cpu=9600000L
2730
picocore.menu.mcu.t13.upload.maximum_size=1024
2831

avr/cores/picocore/Arduino.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* 20200310 add digital pin functions
44
* 20200301 prototype
55
* 20200319 v0.2beta with analogRead/Write & WDT millis()
6+
* 20200416 v0.2.1 with FlashStringHelper & portxxxxRegister functions
67
*/
78

89
#pragma once
@@ -13,6 +14,10 @@
1314
#include <util/delay.h>
1415
#include "constants.h"
1516

17+
#define min(a,b) ((a)<(b)?(a):(b))
18+
#define max(a,b) ((a)>(b)?(a):(b))
19+
#define abs(x) __builtin_abs(x)
20+
1621
#ifdef __cplusplus
1722
class __FlashStringHelper;
1823
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

avr/cores/picocore/constants.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
static const uint8_t LOW = 0;
55
static const uint8_t HIGH = 1;
6-
static const uint8_t LED_BUILTIN = 2;
7-
static const uint8_t NUM_DIGITAL_PINS = 6;
6+
//static const uint8_t LED_BUILTIN = 2;
7+
enum {LED_BUILTIN = 2};
8+
//static const uint8_t NUM_DIGITAL_PINS = 6;
9+
enum {NUM_DIGITAL_PINS = 6};
810

911
typedef enum {MSBFIRST = 0, LSBFIRST} _bitOrder;
1012

avr/cores/picocore/pcrt.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ __init:
5050
clr r1
5151

5252
.section .init9
53+
.global main
5354
; main must go in .init9 to save rjmp
5455
; rjmp main
5556

avr/platform.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ version=0.1.0
1212
# AVR compile variables
1313
# ---------------------
1414

15-
compiler.warning_flags=-w
15+
#compiler.warning_flags=-w
16+
compiler.warning_flags=
1617
compiler.warning_flags.none=-w
1718
compiler.warning_flags.default=
1819
compiler.warning_flags.more=-Wall
@@ -38,7 +39,7 @@ compiler.objcopy.cmd=avr-objcopy
3839
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
3940
compiler.elf2hex.flags=-O ihex -R .eeprom
4041
compiler.elf2hex.cmd=avr-objcopy
41-
compiler.ldflags=
42+
#compiler.ldflags=
4243
compiler.size.cmd=avr-size
4344

4445
# This can be overridden in boards.txt
@@ -47,7 +48,7 @@ build.extra_flags=
4748
# These can be overridden in platform.local.txt
4849
compiler.c.extra_flags=
4950
# force linker to search for __vectors (in pcrt)
50-
compiler.c.elf.extra_flags=-nostartfiles -Wl,--undefined=__vectors -Wl,--undefined=main
51+
compiler.c.elf.extra_flags=-nostartfiles -Wl,--undefined=__vectors
5152
compiler.S.extra_flags=
5253
compiler.cpp.extra_flags=
5354
compiler.ar.extra_flags=

0 commit comments

Comments
 (0)