diff --git a/examples/chapter11_07/target/micros/avr/startup/int_vect.cpp b/examples/chapter11_07/target/micros/avr/startup/int_vect.cpp index b408d9438..d1aa12b9e 100644 --- a/examples/chapter11_07/target/micros/avr/startup/int_vect.cpp +++ b/examples/chapter11_07/target/micros/avr/startup/int_vect.cpp @@ -5,15 +5,16 @@ // or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include -#include +#include #include -#include +#include +#include +#include extern "C" void __my_startup () __attribute__((section(".startup"), used, noinline)); extern "C" void __vector_unused_irq() __attribute__((signal, used, externally_visible)); -#if configUSE_PREEMPTION == 1 +#if (defined(configUSE_PREEMPTION) && (configUSE_PREEMPTION == 1)) extern "C" void __vector_11 () __attribute__((signal, used, externally_visible, naked)); #else extern "C" void __vector_11 () __attribute__((signal, used, externally_visible)); @@ -31,21 +32,21 @@ void __vector_unused_irq() namespace { - typedef struct struct_isr_type + typedef struct isr_type { - typedef void(*function_type)(); + using function_type = void(*)(); - const std::uint8_t jmp[2]; // JMP instruction (0x940C): 0x0C = low byte, 0x94 = high byte. - const function_type func; // The interrupt service routine. + const std::uint8_t jmp[std::size_t { UINT8_C(2) }]; // JMP instruction (0x940C): 0x0C = low byte, 0x94 = high byte. + const function_type func; // The interrupt service routine. } isr_type; } extern "C" -const volatile std::array __isr_vector __attribute__((section(".isr_vector"))); +const volatile std::array __isr_vector __attribute__((section(".isr_vector"))); extern "C" -const volatile std::array __isr_vector = +const volatile std::array __isr_vector = {{ // addr. nr. interrupt source { { 0x0C, 0x94 }, __my_startup }, // 0x00, 0, reset