Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/chapter04_04/build.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

@rem
@rem Copyright Christopher Kormanyos 2014 - 2024.
@rem Copyright Christopher Kormanyos 2014 - 2025.
@rem Distributed under the Boost Software License,
@rem Version 1.0. (See accompanying file LICENSE_1_0.txt
@rem or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -27,8 +27,8 @@
@set TOOL_PATH=%1
@set TOOL_PREFIX=%2

@set CFLAGS=-Wall -Wextra -pedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions
@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
@set CFLAGS=-Wall -Wextra -Wpedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions
@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
@set CINCLUDES=-Isrc/util/STL -Isrc/mcal/avr -Isrc

@echo.
Expand Down
4 changes: 2 additions & 2 deletions examples/chapter04_04/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright Christopher Kormanyos 2014 - 2024.
# Copyright Christopher Kormanyos 2014 - 2025.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down Expand Up @@ -48,7 +48,7 @@ else
fi

CFLAGS="-Wall -Wextra -pedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions"
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"
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"
CINCLUDES="-Isrc/util/STL -Isrc/mcal/avr -Isrc"

echo
Expand Down
4 changes: 2 additions & 2 deletions examples/chapter09_08/build.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

@rem
@rem Copyright Christopher Kormanyos 2014 - 2021.
@rem Copyright Christopher Kormanyos 2014 - 2025.
@rem Distributed under the Boost Software License,
@rem Version 1.0. (See accompanying file LICENSE_1_0.txt
@rem or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -27,7 +27,7 @@
@set TOOL_PATH=%1
@set TOOL_PREFIX=%2

@set CFLAGS=-C -Wall -Wextra -pedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions -gdwarf-2 -ffunction-sections -fdata-sections
@set CFLAGS=-Wall -Wextra -Wpedantic -mmcu=atmega328p -fsigned-char -O2 -fno-exceptions
@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
@set CINCLUDES=-Isrc/util/STL_C++XX_stdfloat -Isrc/util/STL -Isrc -Isrc/mcal/avr

Expand Down
2 changes: 1 addition & 1 deletion examples/chapter09_08/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# Copyright Christopher Kormanyos 2014 - 2020.
# Copyright Christopher Kormanyos 2014 - 2025.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
16 changes: 14 additions & 2 deletions examples/chapter09_08/chapter09_08.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@
<ClInclude Include="src\mcal\mcal_led_monochrome.h" />
<ClInclude Include="src\mcal\mcal_led_rgb.h" />
<ClInclude Include="src\mcal\mcal_pwm_base.h" />
<ClInclude Include="src\mcal\mcal_reg_access_template.h" />
<ClInclude Include="src\mcal\mcal_reg_dynamic_access_template.h" />
<ClInclude Include="src\mcal\mcal_reg_access_dynamic.h" />
<ClInclude Include="src\mcal\mcal_reg_access_static.h" />
<ClInclude Include="src\mcal\win32\mcal_cpu.h" />
<ClInclude Include="src\mcal\win32\mcal_gpt.h" />
<ClInclude Include="src\mcal\win32\mcal_irq.h" />
Expand Down Expand Up @@ -368,6 +368,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="src\util\STL\ciso646">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="src\util\STL\climits">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand Down Expand Up @@ -444,6 +448,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="src\util\STL\stdfloat">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="src\util\STL\string">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand All @@ -464,6 +472,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="src\util\STL\version">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="src\util\STL_C++XX_stdfloat\cstdfloat" />
</ItemGroup>
<ItemGroup>
Expand Down
57 changes: 33 additions & 24 deletions examples/chapter09_08/chapter09_08.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@
<ClInclude Include="src\mcal\mcal.h">
<Filter>src\mcal</Filter>
</ClInclude>
<ClInclude Include="src\mcal\mcal_reg_access_template.h">
<Filter>src\mcal</Filter>
</ClInclude>
<ClInclude Include="src\os\os.h">
<Filter>src\os</Filter>
</ClInclude>
Expand All @@ -179,9 +176,6 @@
<ClInclude Include="src\os\os_task_control_block.h">
<Filter>src\os</Filter>
</ClInclude>
<ClInclude Include="src\mcal\mcal_reg_dynamic_access_template.h">
<Filter>src\mcal</Filter>
</ClInclude>
<ClInclude Include="src\util\device\util_device_led_base.h">
<Filter>src\util\device</Filter>
</ClInclude>
Expand Down Expand Up @@ -320,9 +314,6 @@
<ClInclude Include="src\util\STL\impl\avr\avr_atomic.h">
<Filter>src\util\STL\impl\avr</Filter>
</ClInclude>
<ClInclude Include="src\util\STL\time.h">
<Filter>src\util\STL</Filter>
</ClInclude>
<ClInclude Include="src\util\utility\util_linear_interpolate.h">
<Filter>src\util\utility</Filter>
</ClInclude>
Expand Down Expand Up @@ -368,11 +359,35 @@
<ClInclude Include="src\util\utility\util_dynamic_array.h">
<Filter>src\util\utility</Filter>
</ClInclude>
<ClInclude Include="src\mcal\mcal_reg_access_dynamic.h">
<Filter>src\mcal</Filter>
</ClInclude>
<ClInclude Include="src\mcal\mcal_reg_access_static.h">
<Filter>src\mcal</Filter>
</ClInclude>
<ClInclude Include="src\util\STL\time.h">
<Filter>src\util\STL</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="src\util\STL_C++XX_stdfloat\cstdfloat">
<Filter>src\util\STL_C++XX_stdfloat</Filter>
</None>
<None Include="src\util\STL\functional">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\initializer_list">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\iterator">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\limits">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\memory">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\numeric">
<Filter>src\util\STL</Filter>
</None>
Expand All @@ -388,6 +403,9 @@
<None Include="src\util\STL\stdexcept">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\stdfloat">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\string">
<Filter>src\util\STL</Filter>
</None>
Expand All @@ -403,6 +421,9 @@
<None Include="src\util\STL\vector">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\version">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\algorithm">
<Filter>src\util\STL</Filter>
</None>
Expand Down Expand Up @@ -439,6 +460,9 @@
<None Include="src\util\STL\cinttypes">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\ciso646">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\climits">
<Filter>src\util\STL</Filter>
</None>
Expand Down Expand Up @@ -466,21 +490,6 @@
<None Include="src\util\STL\ctime">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\functional">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\initializer_list">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\iterator">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\limits">
<Filter>src\util\STL</Filter>
</None>
<None Include="src\util\STL\memory">
<Filter>src\util\STL</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="src\chapter09_08.rc">
Expand Down
13 changes: 7 additions & 6 deletions examples/chapter09_08/src/mcal/avr/mcal_benchmark.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2014.
// Copyright Christopher Kormanyos 2014 - 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -8,18 +8,19 @@
#ifndef MCAL_BENCHMARK_2014_04_16_H_
#define MCAL_BENCHMARK_2014_04_16_H_

#include <cstdint>
#include <mcal_port.h>
#include <mcal_reg.h>

#include <cstdint>

namespace mcal
{
namespace benchmark
{
typedef mcal::port::port_pin<std::uint8_t,
std::uint8_t,
mcal::reg::portd,
UINT8_C(3)> benchmark_port_type;
using benchmark_port_type = mcal::port::port_pin<std::uint8_t,
std::uint8_t,
mcal::reg::portd,
UINT8_C(3)>;
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/chapter09_08/src/mcal/avr/mcal_cpu.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2018.
// Copyright Christopher Kormanyos 2007 - 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -10,7 +10,7 @@
#include <mcal_port.h>
#include <mcal_wdg.h>

void mcal::cpu::init()
auto mcal::cpu::init() -> void
{
mcal::wdg::init(nullptr);
mcal::port::init(nullptr);
Expand Down
12 changes: 6 additions & 6 deletions examples/chapter09_08/src/mcal/avr/mcal_cpu.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2020.
// Copyright Christopher Kormanyos 2007 - 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef MCAL_CPU_2009_02_14_H_
#define MCAL_CPU_2009_02_14_H_
#ifndef MCAL_CPU_2009_02_14_H
#define MCAL_CPU_2009_02_14_H

#include <cstdint>

Expand All @@ -16,10 +16,10 @@
{
void init();

inline void post_init() { }
inline auto post_init() -> void { }

inline void nop() noexcept { asm volatile("nop"); }
inline auto nop() noexcept -> void { asm volatile("nop"); }
}
}

#endif // MCAL_CPU_2009_02_14_H_
#endif // MCAL_CPU_2009_02_14_H
2 changes: 1 addition & 1 deletion examples/chapter09_08/src/mcal/avr/mcal_gpt.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2015.
// Copyright Christopher Kormanyos 2007 - 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
20 changes: 10 additions & 10 deletions examples/chapter09_08/src/mcal/avr/mcal_gpt.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2020.
// Copyright Christopher Kormanyos 2007 - 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef MCAL_GPT_2011_10_20_H_
#define MCAL_GPT_2011_10_20_H_
#ifndef MCAL_GPT_2011_10_20_H
#define MCAL_GPT_2011_10_20_H

#include <util/utility/util_noexcept.h>

#include <chrono>
#include <cstdint>

#include <util/utility/util_noexcept.h>

// Forward declaration of the util::timer template class.
namespace util
{
Expand All @@ -24,21 +24,21 @@
{
namespace gpt
{
typedef void config_type;
typedef std::uint32_t value_type;
using config_type = void;
using value_type = std::uint64_t;

void init(const config_type*);
auto init(const config_type*) -> void;

class secure final
{
static value_type get_time_elapsed();

friend std::chrono::high_resolution_clock::time_point std::chrono::high_resolution_clock::now() UTIL_NOEXCEPT;
friend auto std::chrono::high_resolution_clock::now() -> std::chrono::high_resolution_clock::time_point;

template<typename unsigned_tick_type>
friend class util::timer;
};
}
}

#endif // MCAL_GPT_2011_10_20_H_
#endif // MCAL_GPT_2011_10_20_H
4 changes: 2 additions & 2 deletions examples/chapter09_08/src/mcal/avr/mcal_irq.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2013.
// Copyright Christopher Kormanyos 2007 - 2025.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#include <mcal_irq.h>

void mcal::irq::init(const config_type*)
auto mcal::irq::init(const config_type*) -> void
{
mcal::irq::enable_all();
}
Loading