Skip to content

Commit bab7911

Browse files
committed
Prepare working model for multi-channel gpt
1 parent f2bcf80 commit bab7911

67 files changed

Lines changed: 367 additions & 927 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ref_app/src/mcal/am335x/mcal_gpt.h

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

8-
#ifndef MCAL_GPT_2011_10_20_H_
9-
#define MCAL_GPT_2011_10_20_H_
8+
#ifndef MCAL_GPT_2011_10_20_H
9+
#define MCAL_GPT_2011_10_20_H
1010

11-
#include <chrono>
1211
#include <cstdint>
1312

14-
#include <util/utility/util_noexcept.h>
15-
16-
// Forward declaration of the util::timer template class.
17-
namespace util
18-
{
19-
template<typename unsigned_tick_type>
20-
class timer;
21-
}
22-
2313
namespace mcal
2414
{
2515
namespace gpt
@@ -29,16 +19,11 @@
2919

3020
void init(const config_type*);
3121

32-
class secure final
22+
struct secure final
3323
{
3424
static value_type get_time_elapsed();
35-
36-
friend std::chrono::high_resolution_clock::time_point std::chrono::high_resolution_clock::now() UTIL_NOEXCEPT;
37-
38-
template<typename unsigned_tick_type>
39-
friend class util::timer;
4025
};
4126
}
4227
}
4328

44-
#endif // MCAL_GPT_2011_10_20_H_
29+
#endif // MCAL_GPT_2011_10_20_H

ref_app/src/mcal/am335x/mcal_wdg.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2013 - 2020.
2+
// Copyright Christopher Kormanyos 2013 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
66
//
77

8-
#ifndef MCAL_WDG_2010_04_10_H_
9-
#define MCAL_WDG_2010_04_10_H_
10-
11-
extern "C" void __my_startup() __attribute__((section(".startup"), used, noinline));
12-
13-
namespace sys { namespace idle { void task_func(); } }
8+
#ifndef MCAL_WDG_2010_04_10_H
9+
#define MCAL_WDG_2010_04_10_H
1410

1511
namespace mcal
1612
{
@@ -20,14 +16,11 @@
2016

2117
void init(const config_type*);
2218

23-
class secure final
19+
struct secure final
2420
{
2521
static void trigger();
26-
27-
friend void ::sys::idle::task_func();
28-
friend void ::__my_startup();
2922
};
3023
}
3124
}
3225

33-
#endif // MCAL_WDG_2010_04_10_H_
26+
#endif // MCAL_WDG_2010_04_10_H

ref_app/src/mcal/am6254_soc/mcal_gpt.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@
88
#ifndef MCAL_GPT_2025_02_22_H
99
#define MCAL_GPT_2025_02_22_H
1010

11-
#include <chrono>
1211
#include <cstdint>
1312

14-
// Forward declaration of the util::timer template class.
15-
namespace util
16-
{
17-
template<typename unsigned_tick_type>
18-
class timer;
19-
}
20-
2113
namespace mcal
2214
{
2315
namespace gpt
@@ -29,13 +21,7 @@
2921

3022
struct secure final
3123
{
32-
private:
3324
static auto get_time_elapsed() -> value_type;
34-
35-
friend auto std::chrono::high_resolution_clock::now() noexcept -> std::chrono::high_resolution_clock::time_point;
36-
37-
template<typename unsigned_tick_type>
38-
friend class util::timer;
3925
};
4026
}
4127
}

ref_app/src/mcal/am6254_soc/mcal_wdg.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
66
//
77

8-
#ifndef MCAL_WDG_2010_04_10_H_
9-
#define MCAL_WDG_2010_04_10_H_
10-
11-
namespace util { template<typename unsigned_tick_type> class timer; }
12-
13-
namespace sys { namespace idle { auto task_func() -> void; } }
8+
#ifndef MCAL_WDG_2010_04_10_H
9+
#define MCAL_WDG_2010_04_10_H
1410

1511
namespace mcal
1612
{
@@ -20,16 +16,11 @@
2016

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

23-
class secure final
19+
struct secure final
2420
{
2521
static auto trigger() -> void;
26-
27-
template<typename unsigned_tick_type>
28-
friend class util::timer;
29-
30-
friend auto ::sys::idle::task_func() -> void;
3122
};
3223
}
3324
}
3425

35-
#endif // MCAL_WDG_2010_04_10_H_
26+
#endif // MCAL_WDG_2010_04_10_H
Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2007 - 2020.
2+
// Copyright Christopher Kormanyos 2007 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
66
//
77

8-
#ifndef MCAL_GPT_2011_10_20_H_
9-
#define MCAL_GPT_2011_10_20_H_
8+
#ifndef MCAL_GPT_2011_10_20_H
9+
#define MCAL_GPT_2011_10_20_H
1010

11-
#include <chrono>
1211
#include <cstdint>
1312

14-
#include <util/utility/util_noexcept.h>
15-
16-
// Forward declaration of the util::timer template class.
17-
namespace util
18-
{
19-
template<typename unsigned_tick_type>
20-
class timer;
21-
}
22-
2313
namespace mcal
2414
{
2515
namespace gpt
@@ -31,15 +21,9 @@
3121

3222
struct secure final
3323
{
34-
private:
3524
static value_type get_time_elapsed();
36-
37-
friend std::chrono::high_resolution_clock::time_point std::chrono::high_resolution_clock::now() UTIL_NOEXCEPT;
38-
39-
template<typename unsigned_tick_type>
40-
friend class util::timer;
4125
};
4226
}
4327
}
4428

45-
#endif // MCAL_GPT_2011_10_20_H_
29+
#endif // MCAL_GPT_2011_10_20_H

ref_app/src/mcal/atmega2560/mcal_wdg.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2007 - 2018.
2+
// Copyright Christopher Kormanyos 2007 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,12 +8,6 @@
88
#ifndef MCAL_WDT_2010_04_10_H_
99
#define MCAL_WDT_2010_04_10_H_
1010

11-
extern "C" void __my_startup() __attribute__((section(".startup"), used, noinline));
12-
13-
namespace sys { namespace idle { void task_func(); } }
14-
15-
namespace util { template<typename unsigned_tick_type> class timer; }
16-
1711
namespace mcal
1812
{
1913
namespace wdg
@@ -24,13 +18,6 @@
2418

2519
struct secure final
2620
{
27-
private:
28-
friend void ::sys::idle::task_func();
29-
friend void ::__my_startup();
30-
31-
template<typename unsigned_tick_type>
32-
friend class util::timer;
33-
3421
static void trigger() { asm volatile("wdr"); }
3522
};
3623
}
Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2007 - 2020.
2+
// Copyright Christopher Kormanyos 2007 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
66
//
77

8-
#ifndef MCAL_GPT_2011_10_20_H_
9-
#define MCAL_GPT_2011_10_20_H_
8+
#ifndef MCAL_GPT_2011_10_20_H
9+
#define MCAL_GPT_2011_10_20_H
1010

11-
#include <chrono>
1211
#include <cstdint>
1312

14-
#include <util/utility/util_noexcept.h>
15-
16-
// Forward declaration of the util::timer template class.
17-
namespace util
18-
{
19-
template<typename unsigned_tick_type>
20-
class timer;
21-
}
22-
2313
namespace mcal
2414
{
2515
namespace gpt
@@ -31,15 +21,9 @@
3121

3222
struct secure final
3323
{
34-
private:
3524
static value_type get_time_elapsed();
36-
37-
friend std::chrono::high_resolution_clock::time_point std::chrono::high_resolution_clock::now() UTIL_NOEXCEPT;
38-
39-
template<typename unsigned_tick_type>
40-
friend class util::timer;
4125
};
4226
}
4327
}
4428

45-
#endif // MCAL_GPT_2011_10_20_H_
29+
#endif // MCAL_GPT_2011_10_20_H

ref_app/src/mcal/atmega4809/mcal_wdg.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// Copyright Christopher Kormanyos 2007 - 2023.
2+
// Copyright Christopher Kormanyos 2007 - 2025.
33
// Distributed under the Boost Software License,
44
// Version 1.0. (See accompanying file LICENSE_1_0.txt
55
// or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -8,12 +8,6 @@
88
#ifndef MCAL_WDT_2010_04_10_H
99
#define MCAL_WDT_2010_04_10_H
1010

11-
extern "C" auto __my_startup() -> void __attribute__((section(".startup"), used, noinline));
12-
13-
namespace sys { namespace idle { auto task_func() -> void; } }
14-
15-
namespace util { template<typename unsigned_tick_type> class timer; }
16-
1711
namespace mcal
1812
{
1913
namespace wdg
@@ -24,13 +18,6 @@
2418

2519
struct secure final
2620
{
27-
private:
28-
friend auto ::sys::idle::task_func() -> void;
29-
friend auto ::__my_startup() -> void;
30-
31-
template<typename unsigned_tick_type>
32-
friend class util::timer;
33-
3421
static auto trigger() -> void;
3522
};
3623
}

ref_app/src/mcal/avr/mcal_gpt.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,8 @@
88
#ifndef MCAL_GPT_2011_10_20_H
99
#define MCAL_GPT_2011_10_20_H
1010

11-
#include <chrono>
1211
#include <cstdint>
1312

14-
// Forward declaration of the util::timer template class.
15-
namespace util
16-
{
17-
template<typename unsigned_tick_type>
18-
class timer;
19-
}
20-
2113
namespace mcal
2214
{
2315
namespace gpt
@@ -29,13 +21,7 @@
2921

3022
struct secure final
3123
{
32-
private:
3324
static auto get_time_elapsed() -> value_type;
34-
35-
friend auto std::chrono::high_resolution_clock::now() noexcept -> std::chrono::high_resolution_clock::time_point;
36-
37-
template<typename unsigned_tick_type>
38-
friend class util::timer;
3925
};
4026
}
4127
}

ref_app/src/mcal/avr/mcal_wdg.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@
88
#ifndef MCAL_WDT_2010_04_10_H
99
#define MCAL_WDT_2010_04_10_H
1010

11-
#include <util/utility/util_attribute.h>
12-
13-
extern "C" void __my_startup() ATTRIBUTE(section(".startup"), used, noinline);
14-
15-
namespace sys { namespace idle { auto task_func() -> void; } }
16-
17-
namespace util { template<typename unsigned_tick_type> class timer; }
18-
1911
namespace mcal
2012
{
2113
namespace wdg
@@ -26,13 +18,6 @@
2618

2719
struct secure final
2820
{
29-
private:
30-
friend auto ::sys::idle::task_func() -> void;
31-
friend void ::__my_startup();
32-
33-
template<typename unsigned_tick_type>
34-
friend class util::timer;
35-
3621
static auto trigger() -> void;
3722
};
3823
}

0 commit comments

Comments
 (0)