Skip to content

Commit 6fd4d9d

Browse files
committed
More modernization Examples Chap 9
1 parent 002d6ac commit 6fd4d9d

61 files changed

Lines changed: 2170 additions & 1298 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/chapter04_04a/target/micros/avr/make/avr.ld

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright Christopher Kormanyos 2007 - 2023.
2+
Copyright Christopher Kormanyos 2007 - 2025.
33
Distributed under the Boost Software License,
44
Version 1.0. (See accompanying file LICENSE_1_0.txt
55
or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -12,6 +12,10 @@ INPUT(libc.a libm.a libgcc.a)
1212
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
1313
OUTPUT_ARCH(avr:5)
1414

15+
/* The beginning and end of the program ROM area. */
16+
_rom_begin = 0x00000000;
17+
_rom_end = 0x00007FFC;
18+
1519
/* The beginning and end (i.e., top) of the stack */
1620
/* Set up a stack with a size of 0x180=(3/8)K */
1721
_stack_begin = 0x00800780;
@@ -22,9 +26,8 @@ __initial_stack_pointer = 0x00800900 - 2;
2226

2327
MEMORY
2428
{
25-
VEC(rx) : ORIGIN = 0x00000000, LENGTH = 0x00000080
26-
ROM(rx) : ORIGIN = 0x00000080, LENGTH = 32K - 0x00000080
27-
RAM(rwx) : ORIGIN = 0x00800100, LENGTH = 0x00000780 - 0x00000100
29+
ROM(rx) : ORIGIN = 0, LENGTH = 32K - 4
30+
RAM(rw!x) : ORIGIN = 0x00800100, LENGTH = 0x00000780 - 0x00000100
2831
}
2932

3033
SECTIONS
@@ -38,7 +41,7 @@ SECTIONS
3841
*(.isr_vector)
3942
. = ALIGN(0x10);
4043
KEEP(*(.isr_vector))
41-
} > VEC = 0x5555
44+
} > ROM = 0xAAAA
4245

4346
/* Startup code */
4447
.startup :
@@ -67,6 +70,11 @@ SECTIONS
6770
. = ALIGN(2);
6871
} > ROM
6972

73+
.text :
74+
{
75+
. = ALIGN(0x10);
76+
} > ROM = 0xAAAA
77+
7078
. = 0x00800100;
7179
. = ALIGN(2);
7280

@@ -80,7 +88,7 @@ SECTIONS
8088
*(.data*)
8189
. = ALIGN(2);
8290
KEEP (*(.data*))
83-
*(.rodata) /* Use special handling of rodata (i.e., as part of data since _const_ variables are stored in RAM for AVR arch). */
91+
*(.rodata) /* Do *NOT* move this! Include .rodata here if gcc is used with -fdata-sections. */
8492
. = ALIGN(2);
8593
KEEP (*(.rodata))
8694
*(.rodata*)

examples/chapter04_04a/target/micros/avr/make/avr_flags.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
ifneq ($(MAKE),make)
1313
GCC_VERSION = 15.1.0
1414
endif
15+
1516
GCC_TARGET = avr
1617
GCC_PREFIX = avr
1718

@@ -33,7 +34,7 @@ endif
3334
TGT_CFLAGS = -std=c11 \
3435
$(TGT_ALLFLAGS)
3536

36-
TGT_CXXFLAGS = -std=c++14 \
37+
TGT_CXXFLAGS = -std=c++20 \
3738
$(TGT_ALLFLAGS)
3839

3940
TGT_INCLUDES = -I$(PATH_APP)/util/STL

examples/chapter09_08/src/mcal/avr/mcal_led_sys_start_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2017 - 2018.
2+
// Copyright Christopher Kormanyos 2017 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)

examples/chapter09_08/src/sys/start/sys_start.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2007 - 2023.
2+
// Copyright Christopher Kormanyos 2007 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)

0 commit comments

Comments
 (0)