Skip to content

Commit eec2794

Browse files
committed
Merge branch 'master' into bl602_sifive_e24_riscv
2 parents fef1838 + dd34dc4 commit eec2794

16 files changed

Lines changed: 70 additions & 58 deletions

File tree

examples/chapter02_02/build.bat

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
@rem build.bat directory_of_gcc_bin prefix_of_avr_gcc
1313

1414
@rem Usage example A,
15-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02"
16-
@rem build.bat "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
15+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02"
16+
@rem build.bat "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
1717

1818
@rem Usage example A1 (use a relative tool path),
19-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02"
19+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02"
2020
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
2121

2222
@rem Usage example B,
23-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02"
23+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_02"
2424
@rem build.bat "C:\Program Files (x86)\gcc-15.1.0-avr\bin" avr
2525

2626

@@ -39,7 +39,7 @@ if exist bin\led*.* del /Q bin\led*.*
3939
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -fsigned-char -x assembler crt0.s -c -o bin/crt0.o
4040

4141
@echo.Compile : led.cpp to bin/led.o
42-
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -fsigned-char -O2 -std=c++0x -I. -c led.cpp -o bin/led.o
42+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -fsigned-char -O2 -std=c++11 -I. -c led.cpp -o bin/led.o
4343

4444
@echo.Link : objects to bin/led.elf
4545
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -nostartfiles -nostdlib -Wl,-Tavr.ld,-Map,bin/led.map bin/led.o bin/crt0.o -o bin/led.elf

examples/chapter02_02/build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
# ./build.sh /usr/bin avr
2323
#
2424
# Usage example A (from *nix shell)
25-
# cd /usr/local/real-time-cpp/examples/chapter02_02
26-
# ./build.sh /usr/local/real-time-cpp/examples/chapter02_02/tools/Util/MinGW/msys/1.0/local/gcc-9.2.0-avr/bin avr
25+
# cd /mnt/c/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_02
26+
# ./build.sh /mnt/c/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_02/tools/Util/MinGW/msys/1.0/local/gcc-9.2.0-avr/bin avr
2727

2828
# Usage example B (from Win* shell such as in Git for Win*)
29-
# cd C:/Users/User/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_02
30-
# ./build.sh C:/Users/User/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_02/tools/Util/MinGW/msys/1.0/local/gcc-9.2.0-avr/bin avr
29+
# cd C:/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_02
30+
# ./build.sh Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_02/tools/Util/MinGW/msys/1.0/local/gcc-9.2.0-avr/bin avr
3131

3232
if [[ $# == 0 ]]; then ## $# is the number of arguments
3333
if [[ -n "$(which avr-g++)" ]]; then ## -n tests if string is not empty
@@ -61,7 +61,7 @@ echo "Assemble : crt0.s to bin/crt0.o"
6161
$TOOL_PATH/$TOOL_PREFIX-g++ -mmcu=atmega328p -fsigned-char -x assembler crt0.s -c -o bin/crt0.o
6262

6363
echo "Compile : led.cpp to bin/led.o"
64-
$TOOL_PATH/$TOOL_PREFIX-g++ -mmcu=atmega328p -fsigned-char -O2 -std=c++0x -I. -c led.cpp -o bin/led.o
64+
$TOOL_PATH/$TOOL_PREFIX-g++ -mmcu=atmega328p -fsigned-char -O2 -std=c++11 -I. -c led.cpp -o bin/led.o
6565

6666
echo "Link : objects to bin/led.elf"
6767
$TOOL_PATH/$TOOL_PREFIX-g++ -mmcu=atmega328p -nostartfiles -nostdlib -Wl,-Tavr.ld,-Map,bin/led.map bin/led.o bin/crt0.o -o bin/led.elf

examples/chapter02_02/chapter02_02.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<None Include="bin\led.lss" />
1313
<None Include="bin\led.map" />
1414
<None Include="build.bat" />
15+
<None Include="build.sh" />
1516
<None Include="crt0.s" />
1617
<None Include="cstdint" />
1718
</ItemGroup>

examples/chapter02_02/chapter02_02.vcxproj.filters

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<None Include="bin\led.lss">
2020
<Filter>bin</Filter>
2121
</None>
22+
<None Include="build.sh" />
2223
</ItemGroup>
2324
<ItemGroup>
2425
<ClCompile Include="led.cpp" />

examples/chapter02_02/led.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// The LED program.
99

1010
#include "mcal_reg.h"
11+
1112
#include <cstdint>
1213

1314
class led
@@ -57,6 +58,8 @@ namespace
5758
};
5859
}
5960

61+
auto main() -> int;
62+
6063
auto main() -> int
6164
{
6265
// Toggle led_b5 in a loop forever.

examples/chapter02_03/build.bat

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
@rem
3-
@rem Copyright Christopher Kormanyos 2014 - 2020.
3+
@rem Copyright Christopher Kormanyos 2014 - 2025.
44
@rem Distributed under the Boost Software License,
55
@rem Version 1.0. (See accompanying file LICENSE_1_0.txt
66
@rem or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -12,23 +12,23 @@
1212
@rem build.bat directory_of_gcc_bin prefix_of_avr_gcc
1313

1414
@rem Usage example A,
15-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03"
16-
@rem build.bat "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03\tools\Util\msys64\usr\local\gcc-11.2.0-avr\bin" avr
15+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03"
16+
@rem build.bat "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03\tools\Util\msys64\usr\local\gcc-11.2.0-avr\bin" avr
1717

1818
@rem Usage example A1 (use a relative tool path),
19-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03"
20-
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-11.2.0-avr\bin" avr
19+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03"
20+
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
2121

2222
@rem Usage example B,
23-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03"
24-
@rem build.bat "C:\Program Files (x86)\gcc-11.2.0-avr\bin" avr
23+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_03"
24+
@rem build.bat "C:\Program Files (x86)\gcc-15.1.0-avr\bin" avr
2525

2626

2727
@set TOOL_PATH=%1
2828
@set TOOL_PREFIX=%2
2929

30-
@set CFLAGS=-C -Wall -Wextra -pedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions -gdwarf-2 -ffunction-sections -fdata-sections
31-
@set CPPFLAGS= -fno-rtti -fstrict-enums -fno-use-cxa-atexit -fno-use-cxa-get-exception-ptr -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs
30+
@set CFLAGS=-C -Wall -Wextra -Wpedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions -gdwarf-2 -ffunction-sections -fdata-sections
31+
@set CPPFLAGS= -std=c++11 -fno-rtti -fstrict-enums -fno-use-cxa-atexit -fno-use-cxa-get-exception-ptr -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs
3232
@set CINCLUDES=-Isrc/util/STL_C++XX_stdfloat -Isrc/util/STL -Isrc -Isrc/mcal/avr
3333

3434
@echo.

examples/chapter02_03/build.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright Christopher Kormanyos 2014.
3+
# Copyright Christopher Kormanyos 2014 - 2025.
44
# Distributed under the Boost Software License,
55
# Version 1.0. (See accompanying file LICENSE_1_0.txt
66
# or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -22,12 +22,12 @@
2222
# ./build.sh /usr/bin avr
2323
#
2424
# Usage example A (from *nix shell)
25-
# cd /usr/local/real-time-cpp/examples/chapter02_03
26-
# ./build.sh /usr/local/real-time-cpp/examples/chapter02_03/tools/Util/MinGW/msys/1.0/local/gcc-9.2.0-avr/bin avr
25+
# cd /mnt/c/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_03
26+
# ./build.sh /mnt/c/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_03/tools/Util/MinGW/msys/1.0/local/gcc-15.1.0-avr/bin avr
2727

2828
# Usage example B (from Win* shell such as in Git for Win*)
29-
# cd C:/Users/User/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_03
30-
# ./build.sh C:/Users/User/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_03/tools/Util/MinGW/msys/1.0/local/gcc-9.2.0-avr/bin avr
29+
# cd C:/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_03
30+
# ./build.sh Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter02_03/tools/Util/MinGW/msys/1.0/local/gcc-15.1.0-avr/bin avr
3131

3232
if [[ $# == 0 ]]; then ## $# is the number of arguments
3333
if [[ -n "$(which avr-g++)" ]]; then ## -n tests if string is not empty
@@ -47,8 +47,8 @@ else
4747
TOOL_PREFIX="$2"
4848
fi
4949

50-
CFLAGS="-Wall -Wextra -pedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions -gdwarf-2 -ffunction-sections -fdata-sections"
51-
CPPFLAGS="-std=c++14 -fno-rtti -fstrict-enums -fno-use-cxa-atexit -fno-use-cxa-get-exception-ptr -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs"
50+
CFLAGS="-Wall -Wextra -Wpedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions -gdwarf-2 -ffunction-sections -fdata-sections"
51+
CPPFLAGS="-std=c++11 -fno-rtti -fstrict-enums -fno-use-cxa-atexit -fno-use-cxa-get-exception-ptr -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs"
5252
CINCLUDES="-Isrc/util/STL_C++XX_stdfloat -Isrc/util/STL -Isrc -Isrc/mcal/avr"
5353

5454
echo

examples/chapter02_03/chapter02_03.sln

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30907.101
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36616.10 d17.14
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "target", "target.vcxproj", "{30CE370B-40F3-4BCD-8986-64AAFF8971BD}"
77
EndProject
88
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chapter02_03", "chapter02_03.vcxproj", "{C8B59726-9319-45C3-8F11-F9F388FB6A2C}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
11+
ProjectSection(SolutionItems) = preProject
12+
build.bat = build.bat
13+
build.sh = build.sh
14+
EndProjectSection
15+
EndProject
1016
Global
1117
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1218
Debug|x64 = Debug|x64

examples/chapter02_03/target/build/build.bat

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

examples/chapter02_06/build.bat

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
@rem build.bat directory_of_gcc_bin prefix_of_avr_gcc
1313

1414
@rem Usage example A,
15-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06"
16-
@rem build.bat "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06\tools\Util\msys64\usr\local\gcc-11.2.0-avr\bin" avr
15+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06"
16+
@rem build.bat "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
1717

1818
@rem Usage example A1 (use a relative tool path),
19-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06"
20-
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-11.2.0-avr\bin" avr
19+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06"
20+
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
2121

2222
@rem Usage example B,
23-
@rem cd "C:\Users\User\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06"
24-
@rem build.bat "C:\Program Files (x86)\gcc-11.2.0-avr\bin" avr
23+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter02_06"
24+
@rem build.bat "C:\Program Files (x86)\gcc-15.1.0-avr\bin" avr
2525

2626

2727
@set TOOL_PATH=%1
@@ -39,7 +39,7 @@ if exist bin\led*.* del /Q bin\led*.*
3939
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -fsigned-char -x assembler crt0.s -c -o bin/crt0.o
4040

4141
@echo.Compile : led.cpp to bin/led.o
42-
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -fsigned-char -O2 -std=c++0x -I. -c led.cpp -o bin/led.o
42+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -fsigned-char -O2 -std=c++11 -I. -c led.cpp -o bin/led.o
4343

4444
@echo.Link : objects to bin/led.elf
4545
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -mmcu=atmega328p -nostartfiles -nostdlib -Wl,-Tavr.ld,-Map,bin/led.map bin/led.o bin/crt0.o -o bin/led.elf

0 commit comments

Comments
 (0)