Skip to content

Commit de6ad91

Browse files
committed
Add bash/batch scripts 11_07a
1 parent 92454c7 commit de6ad91

13 files changed

Lines changed: 363 additions & 40 deletions

File tree

.github/workflows/real-time-cpp-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
example: [ chapter02_03, chapter02_03a, chapter03_02, chapter04_04, chapter04_04a, chapter06_01, chapter06_14, chapter09_07, chapter09_08, chapter09_08a, chapter10_08, chapter10_08a, chapter11_07, chapter12_04, chapter16_08, chapter17_03, chapter17_03a ]
45+
example: [ chapter02_03, chapter02_03a, chapter03_02, chapter04_04, chapter04_04a, chapter06_01, chapter06_14, chapter09_07, chapter09_08, chapter09_08a, chapter10_08, chapter10_08a, chapter11_07, chapter11_07a, chapter12_04, chapter16_08, chapter17_03, chapter17_03a ]
4646
steps:
4747
- uses: actions/checkout@v4
4848
with:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
*~
21
.vscode/
32
ref_app/.vs/
43
ref_app/ref_app.vcxproj.user

examples/chapter09_08a/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@set TOOL_PATH=%1
2828
@set TOOL_PREFIX=%2
2929

30-
@set CFLAGS=-Wall -Wextra -Wpedantic -O2 -mmcu=atmega328p -fsigned-char -fno-exceptions
30+
@set CFLAGS=-Wall -Wextra -Wpedantic -O2 -mmcu=atmega328p -fsigned-char -fno-exceptions -gdwarf-2
3131
@set 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
3232
@set CINCLUDES=-Isrc/util/STL_C++XX_stdfloat -Isrc/util/STL -Isrc -Isrc/mcal/avr
3333

examples/chapter09_08a/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
# If command
1414
# /usr/bin/avr-g++
15-
# installed, e.g. via command sudo apt-get install gcc-avr avr-libc
15+
# installed, e.g. via command sudo apt-get install gcc-avr avr-libc
1616
# then:
1717
# ./build.sh
1818
#

examples/chapter11_07a/build.bat

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
2+
@rem
3+
@rem Copyright Christopher Kormanyos 2014 - 2025.
4+
@rem Distributed under the Boost Software License,
5+
@rem Version 1.0. (See accompanying file LICENSE_1_0.txt
6+
@rem or copy at http://www.boost.org/LICENSE_1_0.txt)
7+
@rem
8+
9+
10+
@rem
11+
@rem Usage:
12+
@rem build.bat directory_of_gcc_bin prefix_of_avr_gcc
13+
14+
@rem Usage example A,
15+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter11_07a"
16+
@rem build.bat "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter11_07a\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
17+
18+
@rem Usage example A1 (use a relative tool path),
19+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter11_07a"
20+
@rem build.bat ".\tools\Util\msys64\usr\local\gcc-15.1.0-avr\bin" avr
21+
22+
@rem Usage example B,
23+
@rem cd "C:\Users\ckorm\Documents\Ks\uC_Software\Boards\real-time-cpp\examples\chapter11_07a"
24+
@rem build.bat "C:\Program Files (x86)\gcc-15.1.0-avr\bin" avr
25+
26+
27+
@set TOOL_PATH=%1
28+
@set TOOL_PREFIX=%2
29+
30+
@set CFLAGS=-C -Wall -Wextra -Wpedantic -O2 -mmcu=atmega328p -fsigned-char -fno-exceptions -gdwarf-2
31+
@set 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
32+
@set CINCLUDES=-Isrc/os/FreeRTOS/Source/include/cfg/GCC-ATMega328 -Isrc/os/FreeRTOS/Source/portable/GCC-ATMega328 -Isrc/os/FreeRTOS/Source/include -Isrc/util/STL -Isrc/mcal/avr -Isrc/app -Isrc
33+
34+
@echo.
35+
@echo.Building with : build.bat
36+
@echo.Using tool path : %TOOL_PATH%
37+
@echo.Using tool prefix : %TOOL_PREFIX%
38+
@echo.Create bin directory : bin\
39+
@if not exist bin mkdir bin
40+
@echo.Clean bin directory : bin\*.o bin\chapter11_07a*.*
41+
@if exist bin\*.o del /Q bin\*.o
42+
@if exist bin\chapter11_07a*.* del /Q bin\chapter11_07a*.*
43+
@echo.
44+
45+
@echo.Compile : app_led.cpp to bin/app_led.o
46+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/app/led/app_led.cpp -o bin/app_led.o
47+
48+
@echo.Compile : pi_spigot.cpp to bin/pi_spigot.o
49+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/app/pi_spigot/pi_spigot.cpp -o bin/pi_spigot.o
50+
51+
@echo.Compile : pi_spigot_callback.cpp to bin/pi_spigot_callback.o
52+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/app/pi_spigot/pi_spigot_callback.cpp -o bin/pi_spigot_callback.o
53+
54+
@echo.Compile : mcal.cpp to bin/mcal.o
55+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/mcal.cpp -o bin/mcal.o
56+
57+
@echo.Compile : mcal_gcc_cxx_completion.cpp to bin/mcal_gcc_cxx_completion.o
58+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/mcal_gcc_cxx_completion.cpp -o bin/mcal_gcc_cxx_completion.o
59+
60+
@echo.Compile : mcal_cpu.cpp to bin/mcal_cpu.o
61+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_cpu.cpp -o bin/mcal_cpu.o
62+
63+
@echo.Compile : mcal_dev.cpp to bin/mcal_dev.o
64+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_dev.cpp -o bin/mcal_dev.o
65+
66+
@echo.Compile : mcal_gpt.cpp to bin/mcal_gpt.o
67+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_gpt.cpp -o bin/mcal_gpt.o
68+
69+
@echo.Compile : mcal_irq.cpp to bin/mcal_irq.o
70+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_irq.cpp -o bin/mcal_irq.o
71+
72+
@echo.Compile : mcal_lcd.cpp to bin/mcal_lcd.o
73+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_lcd.cpp -o bin/mcal_lcd.o
74+
75+
@echo.Compile : mcal_led.cpp to bin/mcal_led.o
76+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_led.cpp -o bin/mcal_led.o
77+
78+
@echo.Compile : mcal_memory_sram.cpp to bin/mcal_memory_sram.o
79+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_memory_sram.cpp -o bin/mcal_memory_sram.o
80+
81+
@echo.Compile : mcal_osc.cpp to bin/mcal_osc.o
82+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_osc.cpp -o bin/mcal_osc.o
83+
84+
@echo.Compile : mcal_port.cpp to bin/mcal_port.o
85+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_port.cpp -o bin/mcal_port.o
86+
87+
@echo.Compile : mcal_wdg.cpp to bin/mcal_wdg.o
88+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/mcal/avr/mcal_wdg.cpp -o bin/mcal_wdg.o
89+
90+
@echo.Compile : event_groups.c to bin/event_groups.o
91+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c %CFLAGS% -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast %CINCLUDES% -c src/os/FreeRTOS/Source/event_groups.c -o bin/event_groups.o
92+
93+
@echo.Compile : list.c to bin/list.o
94+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c %CFLAGS% -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast %CINCLUDES% -c src/os/FreeRTOS/Source/list.c -o bin/list.o
95+
96+
@echo.Compile : queue.c to bin/queue.o
97+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c %CFLAGS% -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast %CINCLUDES% -c src/os/FreeRTOS/Source/queue.c -o bin/queue.o
98+
99+
@echo.Compile : tasks.c to bin/tasks.o
100+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c %CFLAGS% -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast %CINCLUDES% -c src/os/FreeRTOS/Source/tasks.c -o bin/tasks.o
101+
102+
@echo.Compile : application.c to bin/application.o
103+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c %CFLAGS% -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast %CINCLUDES% -c src/os/FreeRTOS/Source/application/application.c -o bin/application.o
104+
105+
@echo.Compile : port.cpp to bin/port.o
106+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/os/FreeRTOS/Source/portable/GCC-ATMega328/port.cpp -o bin/port.o
107+
108+
@echo.Compile : sys_start.cpp to bin/sys_start.o
109+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c src/sys/start/sys_start.cpp -o bin/sys_start.o
110+
111+
@echo.Compile : crt0.cpp to bin/crt0.o
112+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/avr/startup/crt0.cpp -o bin/crt0.o
113+
114+
@echo.Compile : crt0_init_ram.cpp to bin/crt0_init_ram.o
115+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/avr/startup/crt0_init_ram.cpp -o bin/crt0_init_ram.o
116+
117+
@echo.Compile : crt1.cpp to bin/crt1.o
118+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/avr/startup/crt1.cpp -o bin/crt1.o
119+
120+
@echo.Compile : int_vect.cpp to bin/int_vect.o
121+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x c++ %CFLAGS% %CPPFLAGS% %CINCLUDES% -c target/micros/avr/startup/int_vect.cpp -o bin/int_vect.o
122+
123+
@echo.Link : objects to bin/chapter11_07a.elf
124+
@%TOOL_PATH%\%TOOL_PREFIX%-g++ -x none -mrelax -nostartfiles %CFLAGS% %CPPFLAGS% %CINCLUDES% -Wl,--gc-sections -Wl,-Ttarget/micros/avr/make/avr.ld,-Map,bin/chapter11_07a.map bin/app_led.o bin/pi_spigot.o bin/pi_spigot_callback.o bin/mcal.o bin/mcal_gcc_cxx_completion.o bin/mcal_cpu.o bin/mcal_dev.o bin/mcal_gpt.o bin/mcal_irq.o bin/mcal_lcd.o bin/mcal_led.o bin/mcal_memory_sram.o bin/mcal_osc.o bin/mcal_port.o bin/mcal_wdg.o bin/event_groups.o bin/list.o bin/queue.o bin/tasks.o bin/application.o bin/port.o bin/sys_start.o bin/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o -o bin/chapter11_07a.elf
125+
126+
@echo.
127+
@echo.Extract : executable hex file : from bin/chapter11_07a.elf
128+
@%TOOL_PATH%\%TOOL_PREFIX%-objcopy -O ihex bin/chapter11_07a.elf bin/chapter11_07a.hex
129+
130+
@echo.Extract : assembly list file : from bin/chapter11_07a.elf
131+
@%TOOL_PATH%\%TOOL_PREFIX%-objdump --disassemble bin/chapter11_07a.elf > bin/chapter11_07a.lss
132+
133+
@echo.Extract : size information : from bin/chapter11_07a.elf
134+
@%TOOL_PATH%\%TOOL_PREFIX%-size -A -t bin/chapter11_07a.elf > bin\chapter11_07a_size.txt
135+
136+
@echo.Extract : name information : from bin/chapter11_07a.elf
137+
@%TOOL_PATH%\%TOOL_PREFIX%-nm --numeric-sort --print-size bin/chapter11_07a.elf > bin\chapter11_07a_nm.txt
138+
139+
@echo.Extract : demangled names : from bin/chapter11_07a.elf
140+
@%TOOL_PATH%\%TOOL_PREFIX%-nm --numeric-sort --print-size bin/chapter11_07a.elf | %TOOL_PATH%\%TOOL_PREFIX%-c++filt > bin\chapter11_07a_cppfilt.txt
141+
142+
dir .\bin\chapter11_07a.elf .\bin\chapter11_07a.hex
143+
144+
if not exist .\bin\chapter11_07a.elf exit 1
145+
if not exist .\bin\chapter11_07a.hex exit 1
146+
147+
rem exit 0

examples/chapter11_07a/build.sh

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright Christopher Kormanyos 2014 - 2025.
4+
# Distributed under the Boost Software License,
5+
# Version 1.0. (See accompanying file LICENSE_1_0.txt
6+
# or copy at http://www.boost.org/LICENSE_1_0.txt)
7+
#
8+
9+
10+
#
11+
# Usage:
12+
#
13+
# If command
14+
# /usr/bin/avr-g++
15+
# installed, e.g. via command sudo apt-get install gcc-avr avr-libc
16+
# then:
17+
# ./build.sh
18+
#
19+
# Otherwise for custom installations
20+
# ./build.sh directory_of_gcc_bin avr
21+
# For example,
22+
# ./build.sh /usr/bin avr
23+
#
24+
# Usage example A (from *nix shell)
25+
# cd /usr/local/real-time-cpp/examples/chapter11_07a
26+
# ./build.sh /usr/local/real-time-cpp/examples/chapter11_07a/tools/Util/msys64/usr/local/gcc-15.1.0-avr/bin avr
27+
28+
# Usage example B (from Win* shell such as in Git for Win*)
29+
# cd C:/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter11_07a
30+
# ./build.sh C:/Users/ckorm/Documents/Ks/uC_Software/Boards/real-time-cpp/examples/chapter11_07a/tools/Util/msys64/usr/local/gcc-15.1.0-avr/bin avr
31+
32+
if [[ $# == 0 ]]; then ## $# is the number of arguments
33+
if [[ -n "$(which avr-g++)" ]]; then ## -n tests if string is not empty
34+
TOOL_PATH="$(dirname $(which avr-g++))"
35+
TOOL_PREFIX=avr
36+
else
37+
echo
38+
echo "Try: apt-get install gcc-avr avr-libc"
39+
echo "Then: ./build.sh"
40+
echo "Otherwise, if you're using a custom avr, use: ./build.sh /directory/to/gcc_avr_bin Prefix"
41+
echo " (such that /directory/to/gcc_avr_bin/Prefix-g++ is the name"
42+
echo " of the c++ compiler)"
43+
exit 1
44+
fi
45+
else
46+
TOOL_PATH="$1"
47+
TOOL_PREFIX="$2"
48+
fi
49+
50+
CFLAGS="-Wall -Wextra -Wpedantic -Os -mmcu=atmega328p -mrelax -fsigned-char -finline-functions -finline-limit=256 -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"
52+
CINCLUDES="-Isrc/os/FreeRTOS/Source/include/cfg/GCC-ATMega328 -Isrc/os/FreeRTOS/Source/portable/GCC-ATMega328 -Isrc/os/FreeRTOS/Source/include -Isrc/util/STL -Isrc/mcal/avr -Isrc/app -Isrc"
53+
54+
echo
55+
echo "Building with : build.sh"
56+
echo "Using tool path : $TOOL_PATH"
57+
echo "Using tool prefix : $TOOL_PREFIX"
58+
echo "Remove bin directory : bin/"
59+
rm -rf bin/
60+
echo "Create bin directory : bin/"
61+
mkdir -p bin
62+
echo
63+
64+
echo "Compile : app_led.cpp to bin/app_led.o"
65+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/app/led/app_led.cpp -o bin/app_led.o
66+
67+
echo "Compile : pi_spigot.cpp to bin/pi_spigot.o"
68+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/app/pi_spigot/pi_spigot.cpp -o bin/pi_spigot.o
69+
70+
echo "Compile : pi_spigot_callback.cpp to bin/pi_spigot_callback.o"
71+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/app/pi_spigot/pi_spigot_callback.cpp -o bin/pi_spigot_callback.o
72+
73+
echo "Compile : mcal.cpp to bin/mcal.o"
74+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/mcal.cpp -o bin/mcal.o
75+
76+
echo "Compile : mcal_gcc_cxx_completion.cpp to bin/mcal_gcc_cxx_completion.o"
77+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/mcal_gcc_cxx_completion.cpp -o bin/mcal_gcc_cxx_completion.o
78+
79+
echo "Compile : mcal_cpu.cpp to bin/mcal_cpu.o"
80+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_cpu.cpp -o bin/mcal_cpu.o
81+
82+
echo "Compile : mcal_dev.cpp to bin/mcal_dev.o"
83+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_dev.cpp -o bin/mcal_dev.o
84+
85+
echo "Compile : mcal_gpt.cpp to bin/mcal_gpt.o"
86+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_gpt.cpp -o bin/mcal_gpt.o
87+
88+
echo "Compile : mcal_irq.cpp to bin/mcal_irq.o"
89+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_irq.cpp -o bin/mcal_irq.o
90+
91+
echo "Compile : mcal_lcd.cpp to bin/mcal_lcd.o"
92+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_lcd.cpp -o bin/mcal_lcd.o
93+
94+
echo "Compile : mcal_led.cpp to bin/mcal_led.o"
95+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_led.cpp -o bin/mcal_led.o
96+
97+
echo "Compile : mcal_memory_sram.cpp to bin/mcal_memory_sram.o"
98+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_memory_sram.cpp -o bin/mcal_memory_sram.o
99+
100+
echo "Compile : mcal_osc.cpp to bin/mcal_osc.o"
101+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_osc.cpp -o bin/mcal_osc.o
102+
103+
echo "Compile : mcal_port.cpp to bin/mcal_port.o"
104+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_port.cpp -o bin/mcal_port.o
105+
106+
echo "Compile : mcal_wdg.cpp to bin/mcal_wdg.o"
107+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/mcal/avr/mcal_wdg.cpp -o bin/mcal_wdg.o
108+
109+
echo "Compile : event_groups.c to bin/event_groups.o"
110+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c -std=gnu11 $CFLAGS -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast $CINCLUDES -c src/os/FreeRTOS/Source/event_groups.c -o bin/event_groups.o
111+
112+
echo "Compile : list.c to bin/list.o"
113+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c -std=gnu11 $CFLAGS -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast $CINCLUDES -c src/os/FreeRTOS/Source/list.c -o bin/list.o
114+
115+
echo "Compile : queue.c to bin/queue.o"
116+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c -std=gnu11 $CFLAGS -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast $CINCLUDES -c src/os/FreeRTOS/Source/queue.c -o bin/queue.o
117+
118+
echo "Compile : tasks.c to bin/tasks.o"
119+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c -std=gnu11 $CFLAGS -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast $CINCLUDES -c src/os/FreeRTOS/Source/tasks.c -o bin/tasks.o
120+
121+
echo "Compile : application.c to bin/application.o"
122+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c -std=gnu11 $CFLAGS -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast $CINCLUDES -c src/os/FreeRTOS/Source/application/application.c -o bin/application.o
123+
124+
echo "Compile : port.cpp to bin/port.o"
125+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/os/FreeRTOS/Source/portable/GCC-ATMega328/port.cpp -o bin/port.o
126+
127+
echo "Compile : sys_start.cpp to bin/sys_start.o"
128+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c src/sys/start/sys_start.cpp -o bin/sys_start.o
129+
130+
echo "Compile : crt0.cpp to bin/crt0.o"
131+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/avr/startup/crt0.cpp -o bin/crt0.o
132+
133+
echo "Compile : crt0_init_ram.cpp to bin/crt0_init_ram.o"
134+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/avr/startup/crt0_init_ram.cpp -o bin/crt0_init_ram.o
135+
136+
echo "Compile : crt1.cpp to bin/crt1.o"
137+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/avr/startup/crt1.cpp -o bin/crt1.o
138+
139+
echo "Compile : int_vect.cpp to bin/int_vect.o"
140+
$TOOL_PATH/$TOOL_PREFIX-g++ -x c++ $CFLAGS $CPPFLAGS $CINCLUDES -c target/micros/avr/startup/int_vect.cpp -o bin/int_vect.o
141+
142+
echo "Link : objects to bin/chapter11_07a.elf"
143+
$TOOL_PATH/$TOOL_PREFIX-g++ -x none -mrelax -nostartfiles $CFLAGS $CPPFLAGS $CINCLUDES -Wl,--gc-sections -Wl,-Ttarget/micros/avr/make/avr.ld,-Map,bin/chapter11_07a.map bin/app_led.o bin/pi_spigot.o bin/pi_spigot_callback.o bin/mcal.o bin/mcal_gcc_cxx_completion.o bin/mcal_cpu.o bin/mcal_dev.o bin/mcal_gpt.o bin/mcal_irq.o bin/mcal_lcd.o bin/mcal_led.o bin/mcal_memory_sram.o bin/mcal_osc.o bin/mcal_port.o bin/mcal_wdg.o bin/event_groups.o bin/list.o bin/queue.o bin/tasks.o bin/application.o bin/port.o bin/sys_start.o bin/crt0.o bin/crt0_init_ram.o bin/crt1.o bin/int_vect.o -o bin/chapter11_07a.elf
144+
145+
echo
146+
echo "Extract : executable hex file : from bin/chapter11_07a.elf"
147+
$TOOL_PATH/$TOOL_PREFIX-objcopy -O ihex bin/chapter11_07a.elf bin/chapter11_07a.hex
148+
149+
echo "Extract : assembly list file : from bin/chapter11_07a.elf"
150+
$TOOL_PATH/$TOOL_PREFIX-objdump --disassemble bin/chapter11_07a.elf > bin/chapter11_07a.lss
151+
152+
echo "Extract : size information : from bin/chapter11_07a.elf"
153+
$TOOL_PATH/$TOOL_PREFIX-size -A -t bin/chapter11_07a.elf > bin/chapter11_07a_size.txt
154+
155+
echo "Extract : name information : from bin/chapter11_07a.elf"
156+
$TOOL_PATH/$TOOL_PREFIX-nm --numeric-sort --print-size bin/chapter11_07a.elf > bin/chapter11_07a_nm.txt
157+
158+
echo "Extract : demangled names : from bin/chapter11_07a.elf"
159+
$TOOL_PATH/$TOOL_PREFIX-nm --numeric-sort --print-size bin/chapter11_07a.elf | $TOOL_PATH/$TOOL_PREFIX-c++filt > bin/chapter11_07a_cppfilt.txt

examples/chapter11_07a/chapter11_07a.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@
447447
<ClInclude Include="src\util\utility\util_utype_helper.h" />
448448
</ItemGroup>
449449
<ItemGroup>
450+
<None Include="build.bat" />
451+
<None Include="build.sh" />
450452
<None Include="readme.md" />
451453
<None Include="src\util\STL\algorithm">
452454
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

examples/chapter11_07a/chapter11_07a.vcxproj.filters

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,5 +703,7 @@
703703
<None Include="readme.md">
704704
<Filter>_doc</Filter>
705705
</None>
706+
<None Include="build.bat" />
707+
<None Include="build.sh" />
706708
</ItemGroup>
707709
</Project>

0 commit comments

Comments
 (0)