File tree 12 files changed +59
-31
lines changed
12 files changed +59
-31
lines changed Original file line number Diff line number Diff line change 8
8
#ifndef MCAL_WDG_WATCHDOG_2013_12_11_H
9
9
#define MCAL_WDG_WATCHDOG_2013_12_11_H
10
10
11
+ #include < mcal_wdg.h>
12
+
13
+ #include < util/utility/util_noncopyable.h>
14
+ #include < util/utility/util_time.h>
15
+
11
16
#include < atomic>
12
17
#include < cstdint>
13
18
#include < functional>
14
19
#include < thread>
15
20
16
- #include < mcal_wdg.h>
17
- #include < util/utility/util_noncopyable.h>
18
- #include < util/utility/util_time.h>
19
-
20
21
#if defined(_MSC_VER)
21
22
#define MCAL_WDG_NORETURN
22
23
#else
90
91
91
92
MCAL_WDG_NORETURN static auto thread_function () -> void
92
93
{
93
- std::this_thread::sleep_for (std::chrono::milliseconds (10U ));
94
+ std::this_thread::sleep_for (std::chrono::milliseconds (static_cast < unsigned >( UINT8_C ( 10 )) ));
94
95
95
96
bool timeout_has_occurred = false ;
96
97
100
101
{
101
102
print_timeout_message ();
102
103
103
- std::this_thread::sleep_for (std::chrono::milliseconds (500U ));
104
+ std::this_thread::sleep_for (std::chrono::milliseconds (static_cast < unsigned >( UINT16_C ( 500 )) ));
104
105
}
105
106
else
106
107
{
109
110
timeout_has_occurred = true ;
110
111
}
111
112
112
- std::this_thread::sleep_for (std::chrono::milliseconds (20U ));
113
+ std::this_thread::sleep_for (std::chrono::milliseconds (static_cast < unsigned >( UINT8_C ( 20 )) ));
113
114
}
114
115
}
115
116
}
122
123
123
124
template <const typename watchdog_base::base_timer_type::tick_type MyPeriod>
124
125
std::atomic_flag watchdog<MyPeriod>::my_lock = ATOMIC_FLAG_INIT;
125
- }
126
- }
126
+ } // namespace wdg
127
+ } // namespace mcal
127
128
128
129
#endif // MCAL_WDG_WATCHDOG_2013_12_11_H
Original file line number Diff line number Diff line change 12
12
13
13
namespace mcal { namespace led {
14
14
15
- class led_boolean_state_base : public mcal ::led::led_base
15
+ class led_boolean_state_base : public mcal ::led::led_base // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
16
16
{
17
17
protected:
18
18
constexpr led_boolean_state_base () = default;
31
31
bool is_on { };
32
32
};
33
33
34
- } } // namespace mcal::led
34
+ } // namespace led
35
+ } // namespace mcal
35
36
36
37
#endif // MCAL_LED_BOOLEAN_STATE_BASE_2020_08_07_H
Original file line number Diff line number Diff line change 39
39
const std::uint_fast8_t my_index;
40
40
};
41
41
42
- } } // namespace mcal::led
42
+ } // namespace led
43
+ } // namespace mcal
43
44
44
45
#endif // MCAL_LED_CONSOLE_2020_04_23_H
Original file line number Diff line number Diff line change 40
40
mcal::pwm::pwm_base& my_pwm;
41
41
};
42
42
43
- } } // namespace mcal::led
43
+ } // namespace led
44
+ } // namespace mcal
44
45
45
46
#endif // MCAL_LED_PWM_2020_04_23_H
Original file line number Diff line number Diff line change 94
94
}
95
95
};
96
96
97
- } } // namespace mcal::led
97
+ } // namespace led
98
+ } // namespace mcal
98
99
99
100
#endif // MCAL_LED_RGB_BASE_2023_07_12_H
Original file line number Diff line number Diff line change 50
50
~pwm_console () override = default ;
51
51
};
52
52
53
- } }
53
+ } // namespace pwm
54
+ } // namespace mcal
54
55
55
56
#endif // MCAL_PWM_CONSOLE_2020_04_12_H_
Original file line number Diff line number Diff line change 12
12
13
13
namespace mcal { namespace spi {
14
14
15
- class spi_software_dummy : public util ::communication_buffer_depth_one_byte
15
+ class spi_software_dummy : public util ::communication_buffer_depth_one_byte // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
16
16
{
17
17
private:
18
18
using base_class_type = util::communication_buffer_depth_one_byte;
Original file line number Diff line number Diff line change 5
5
// or copy at http://www.boost.org/LICENSE_1_0.txt)
6
6
//
7
7
8
- #ifndef OS_2011_10_20_H_
9
- #define OS_2011_10_20_H_
8
+ #ifndef OS_2011_10_20_H
9
+ #define OS_2011_10_20_H
10
10
11
11
#include < os/os_cfg.h>
12
12
#include < util/utility/util_time.h>
26
26
auto set_event (const task_id_type task_id, const event_type& event_to_set) -> bool;
27
27
auto get_event (event_type& event_to_get) -> void;
28
28
auto clear_event (const event_type& event_to_clear) -> void;
29
- }
29
+ } // namespace os
30
30
31
- #endif // OS_2011_10_20_H_
31
+ #endif // OS_2011_10_20_H
Original file line number Diff line number Diff line change 15
15
#include < util/utility/util_time.h>
16
16
17
17
// Declare the task initialization and the task function of the idle process.
18
- namespace sys { namespace idle { auto task_init () noexcept -> void; auto task_func () -> void; } }
18
+ namespace sys { namespace idle {
19
+
20
+ auto task_init () noexcept -> void; auto task_func () -> void;
21
+
22
+ } // namespace idle
23
+ } // namespace sys
19
24
20
25
// Define symbols for the task initialization and the task function of the idle process.
21
26
#define OS_IDLE_TASK_INIT () sys::idle::task_init()
22
27
#define OS_IDLE_TASK_FUNC () sys::idle::task_func()
23
28
24
29
// Declare all of the task initializations and the task functions.
25
- namespace app { namespace led { auto task_init () -> void; auto task_func () -> void; } }
26
- namespace app { namespace benchmark { auto task_init () -> void; auto task_func () -> void; } }
27
- namespace sys { namespace mon { auto task_init () -> void; auto task_func () -> void; } }
30
+ namespace app { namespace led {
31
+
32
+ auto task_init () -> void; auto task_func () -> void;
33
+
34
+ } // namespace led
35
+ } // namespace app
36
+
37
+ namespace app { namespace benchmark {
38
+
39
+ auto task_init () -> void; auto task_func () -> void;
40
+
41
+ } // namespace benchmark
42
+ } // namespace app
43
+
44
+ namespace sys { namespace mon {
45
+
46
+ auto task_init () -> void; auto task_func () -> void;
47
+
48
+ } // namespace mon
49
+ } // namespace sys
28
50
29
51
namespace os
30
52
{
50
72
51
73
static_assert (std::numeric_limits<os::event_type>::digits >= 16 ,
52
74
" The operating system event_type must be at least 16-bits wide." );
53
- }
75
+ } // namespace os
54
76
55
77
// Configure the operating system tasks.
56
78
Original file line number Diff line number Diff line change 19
19
class task_control_block final
20
20
{
21
21
public:
22
- task_control_block (const function_type init,
23
- const function_type func,
24
- const tick_type cycle,
25
- const tick_type offset)
22
+ task_control_block (const function_type init, // NOLINT(bugprone-easily-swappable-parameters)
23
+ const function_type func, // NOLINT(bugprone-easily-swappable-parameters)
24
+ const tick_type cycle, // NOLINT(bugprone-easily-swappable-parameters)
25
+ const tick_type offset) // NOLINT(bugprone-easily-swappable-parameters)
26
26
: my_init { init },
27
27
my_func { func },
28
28
my_cycle { cycle },
Original file line number Diff line number Diff line change 17
17
18
18
namespace util
19
19
{
20
- class communication_base : private util ::noncopyable
20
+ class communication_base : private util ::noncopyable // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions)
21
21
{
22
22
public:
23
23
virtual ~communication_base () = default ;
Original file line number Diff line number Diff line change 90
90
{
91
91
const timer t_delay (delay);
92
92
93
- while (!t_delay.timeout ())
93
+ while (!t_delay.timeout ()) // NOLINT(altera-id-dependent-backward-branch)
94
94
{
95
95
mcal::wdg::secure::trigger ();
96
96
}
You can’t perform that action at this time.
0 commit comments