Skip to content

Commit 3b06da8

Browse files
committed
release v4.6.4
1 parent af90ca8 commit 3b06da8

20 files changed

+435
-59
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ dkms.conf
6565
example/project/mdk/Objects
6666
example/project/mdk/RTE/Compiler/.*
6767
example/project/mdk/RTE/Device/ARMCM3/.*
68-
example/project/mdk/plooc_example.uvguix.*
68+
example/project/mdk/plooc_example.uvguix.*
69+
CI/PLOOC_template_gcc/MDK-ARM/DebugConfig/PLOOC_template_gcc_STM32F103RC_1.0.0.dbgconf
70+
*@*
71+
*.uvguix.*
72+
RTE_Components.h
73+

CI/PLOOC_template_gcc/MDK-ARM/PLOOC_template_gcc.uvprojx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
<TargetName>PLOOC_template_gcc</TargetName>
1111
<ToolsetNumber>0x4</ToolsetNumber>
1212
<ToolsetName>ARM-ADS</ToolsetName>
13-
<pArmCC>6160000::V6.16::ARMCLANG</pArmCC>
14-
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
13+
<pCCUsed>6210000::V6.21::.\ArmCompilerforEmbedded6.21</pCCUsed>
1514
<uAC6>1</uAC6>
1615
<TargetOption>
1716
<TargetCommonOption>
@@ -187,6 +186,7 @@
187186
<RvdsVP>0</RvdsVP>
188187
<RvdsMve>0</RvdsMve>
189188
<RvdsCdeCp>0</RvdsCdeCp>
189+
<nBranchProt>0</nBranchProt>
190190
<hadIRAM2>0</hadIRAM2>
191191
<hadIROM2>0</hadIROM2>
192192
<StupSel>8</StupSel>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; *************************************************************
2+
; *** Scatter-Loading Description File generated by uVision ***
3+
; *************************************************************
4+
5+
LR_IROM1 0x08000000 0x00040000 { ; load region size_region
6+
ER_IROM1 0x08000000 0x00040000 { ; load address = execution address
7+
*.o (RESET, +First)
8+
*(InRoot$$Sections)
9+
.ANY (+RO)
10+
.ANY (+XO)
11+
}
12+
RW_IRAM1 0x20000000 0x0000C000 { ; RW data
13+
.ANY (+RW +ZI)
14+
}
15+
}
16+

GorgonMeducer.PLOOC.pdsc

+11-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
<repository type="git">https://github.com/GorgonMeducer/PLOOC.git</repository>
1717

1818
<releases>
19-
<release date="2022-11-02" version="4.6.3" url="https://raw.githubusercontent.com/GorgonMeducer/PLOOC/master/cmsis-pack/GorgonMeducer.PLOOC.4.6.3.pack">
19+
<release date="2024-08-25" version="4.6.4" url="https://github.com/GorgonMeducer/PLOOC/releases/download/v4.6.3/GorgonMeducer.PLOOC.4.6.4.pack">
20+
- Add private_method, protected_method and public_method
21+
- Add plooc_malloc_align and plooc_free
22+
- Other minor changes.
23+
</release>
24+
<release date="2022-11-02" version="4.6.3" url="https://github.com/GorgonMeducer/PLOOC/releases/download/v4.6.3/GorgonMeducer.PLOOC.4.6.3.pack">
2025
- Improve compatibility with the latest C++
2126
- Fix template
2227
</release>
@@ -88,15 +93,15 @@
8893
-->
8994

9095
<components>
91-
<component Cclass="Language Extension" Cgroup="PLOOC" Cversion="4.6.2">
96+
<component Cclass="Language Extension" Cgroup="PLOOC" Cversion="4.6.4">
9297
<description>A low-overhead OOPC template.</description>
9398
<files>
9499
<file category="header" name="plooc.h"/>
95100
<file category="header" name="plooc_class.h"/>
96-
<file category="header" name="template/class/class_name.h" attr="template" select="Base Class Template"/>
97-
<file category="source" name="template/class/class_name.c" attr="template" select="Base Class Template"/>
98-
<file category="header" name="template/derived_class/class_name.h" attr="template" select="Derived Class Template"/>
99-
<file category="source" name="template/derived_class/class_name.c" attr="template" select="Derived Class Template"/>
101+
<file category="header" name="template/class/class_name.h" attr="template" select="Base Class Template" version="1.1.0"/>
102+
<file category="source" name="template/class/class_name.c" attr="template" select="Base Class Template" version="1.1.0"/>
103+
<file category="header" name="template/derived_class/class_name.h" attr="template" select="Derived Class Template" version="1.1.0"/>
104+
<file category="source" name="template/derived_class/class_name.c" attr="template" select="Derived Class Template" version="1.1.0"/>
100105
</files>
101106
</component>
102107
</components>

README.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PLOOC (Protected Low-overhead Object-Oriented Programming with ANSI-C) v4.6.3
1+
# PLOOC (Protected Low-overhead Object-Oriented Programming with ANSI-C) v4.6.4
22

33
## Introduction
44

@@ -81,12 +81,23 @@ If you have any questions or suggestions, please feel free to let us know.
8181

8282
## Update Log
8383
---
84-
- \[11/02/2022\] Fix class template, version 4.6.3
84+
- \[08/25/2024\] Fix class template, version 4.6.4
85+
- Updated Readme
8586

86-
- \[12/05/2022\] Improve compatibility with the latest C++ language, version 4.6.2
87+
- Add `__plooc_malloc_align()` and `__plooc_free`
88+
89+
- Add `private_method()`, `protected_method()` and `public_method()`
90+
91+
- Remove the dependency on the GNU extensions
92+
93+
- Other minor changes.
8794

95+
- \[11/02/2022\] Fix class template, version 4.6.3
96+
97+
- \[12/05/2022\] Improve compatibility with the latest C++ language, version 4.6.2
98+
8899
- \[02/01/2022\] Add helper macros for heap, version 4.6.1
89-
- Add ***\_\_new_class()*** and ***\_\_free_class()*** for using malloc and free together with constructors and destructors, i.e. ***xxxx_init()*** and ***xxxx_depose()***.
100+
- Add `__new_class()` and `__free_class()` for using malloc and free together with constructors and destructors, i.e. ***xxxx_init()*** and ***xxxx_depose()***.
90101
- Update example project
91102
- Add CI to github.
92103

-1.89 MB
Binary file not shown.
96.7 KB
Binary file not shown.

cmsis-pack/GorgonMeducer.PLOOC.pdsc

+11-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
<repository type="git">https://github.com/GorgonMeducer/PLOOC.git</repository>
1717

1818
<releases>
19-
<release date="2022-11-02" version="4.6.3" url="https://raw.githubusercontent.com/GorgonMeducer/PLOOC/master/cmsis-pack/GorgonMeducer.PLOOC.4.6.3.pack">
19+
<release date="2024-08-25" version="4.6.4" url="https://github.com/GorgonMeducer/PLOOC/releases/download/v4.6.3/GorgonMeducer.PLOOC.4.6.4.pack">
20+
- Add private_method, protected_method and public_method
21+
- Add plooc_malloc_align and plooc_free
22+
- Other minor changes.
23+
</release>
24+
<release date="2022-11-02" version="4.6.3" url="https://github.com/GorgonMeducer/PLOOC/releases/download/v4.6.3/GorgonMeducer.PLOOC.4.6.3.pack">
2025
- Improve compatibility with the latest C++
2126
- Fix template
2227
</release>
@@ -88,15 +93,15 @@
8893
-->
8994

9095
<components>
91-
<component Cclass="Language Extension" Cgroup="PLOOC" Cversion="4.6.2">
96+
<component Cclass="Language Extension" Cgroup="PLOOC" Cversion="4.6.4">
9297
<description>A low-overhead OOPC template.</description>
9398
<files>
9499
<file category="header" name="plooc.h"/>
95100
<file category="header" name="plooc_class.h"/>
96-
<file category="header" name="template/class/class_name.h" attr="template" select="Base Class Template"/>
97-
<file category="source" name="template/class/class_name.c" attr="template" select="Base Class Template"/>
98-
<file category="header" name="template/derived_class/class_name.h" attr="template" select="Derived Class Template"/>
99-
<file category="source" name="template/derived_class/class_name.c" attr="template" select="Derived Class Template"/>
101+
<file category="header" name="template/class/class_name.h" attr="template" select="Base Class Template" version="1.1.0"/>
102+
<file category="source" name="template/class/class_name.c" attr="template" select="Base Class Template" version="1.1.0"/>
103+
<file category="header" name="template/derived_class/class_name.h" attr="template" select="Derived Class Template" version="1.1.0"/>
104+
<file category="source" name="template/derived_class/class_name.c" attr="template" select="Derived Class Template" version="1.1.0"/>
100105
</files>
101106
</component>
102107
</components>

example/byte_queue/byte_queue.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ void *byte_queue_target_get(byte_queue_t *ptObj);
113113
extern
114114
void byte_queue_target_set(byte_queue_t *ptObj, void *pTarget);
115115

116-
#if defined(__BYTE_QUEUE_CLASS_IMPLEMENT) || defined(__BYTE_QUEUE_CLASS_INHERIT__)
117-
extern mem_t byte_queue_buffer_get(byte_queue_t *ptObj);
118-
#endif
116+
/* protected methods that only derived class can see */
117+
protected_method(
118+
extern mem_t byte_queue_buffer_get(byte_queue_t *ptObj);
119+
)
119120

120121
/*! \note it is very important to undef those macros */
121122
#undef __BYTE_QUEUE_CLASS_INHERIT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m3 -xc
2+
; command above MUST be in first line (no comment above!)
3+
4+
/*
5+
;-------- <<< Use Configuration Wizard in Context Menu >>> -------------------
6+
*/
7+
8+
/*--------------------- Flash Configuration ----------------------------------
9+
; <h> Flash Configuration
10+
; <o0> Flash Base Address <0x0-0xFFFFFFFF:8>
11+
; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8>
12+
; </h>
13+
*----------------------------------------------------------------------------*/
14+
#define __ROM_BASE 0x00000000
15+
#define __ROM_SIZE 0x00080000
16+
17+
/*--------------------- Embedded RAM Configuration ---------------------------
18+
; <h> RAM Configuration
19+
; <o0> RAM Base Address <0x0-0xFFFFFFFF:8>
20+
; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8>
21+
; </h>
22+
*----------------------------------------------------------------------------*/
23+
#define __RAM_BASE 0x20000000
24+
#define __RAM_SIZE 0x00040000
25+
26+
/*--------------------- Stack / Heap Configuration ---------------------------
27+
; <h> Stack / Heap Configuration
28+
; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
29+
; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
30+
; </h>
31+
*----------------------------------------------------------------------------*/
32+
#define __STACK_SIZE 0x00000200
33+
#define __HEAP_SIZE 0x00000C00
34+
35+
/*
36+
;------------- <<< end of configuration section >>> ---------------------------
37+
*/
38+
39+
40+
/*----------------------------------------------------------------------------
41+
User Stack & Heap boundary definition
42+
*----------------------------------------------------------------------------*/
43+
#define __STACK_TOP (__RAM_BASE + __RAM_SIZE) /* starts at end of RAM */
44+
#define __HEAP_BASE (AlignExpr(+0, 8)) /* starts after RW_RAM section, 8 byte aligned */
45+
46+
47+
/*----------------------------------------------------------------------------
48+
Scatter File Definitions definition
49+
*----------------------------------------------------------------------------*/
50+
#define __RO_BASE __ROM_BASE
51+
#define __RO_SIZE __ROM_SIZE
52+
53+
#define __RW_BASE __RAM_BASE
54+
#define __RW_SIZE (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE)
55+
56+
57+
LR_ROM __RO_BASE __RO_SIZE { ; load region size_region
58+
ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address
59+
*.o (RESET, +First)
60+
*(InRoot$$Sections)
61+
.ANY (+RO)
62+
.ANY (+XO)
63+
}
64+
65+
RW_NOINIT __RW_BASE UNINIT __RW_SIZE {
66+
*(.bss.noinit)
67+
}
68+
69+
RW_RAM AlignExpr(+0, 8) (__RW_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) {
70+
*(+RW +ZI)
71+
}
72+
73+
#if __HEAP_SIZE > 0
74+
ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap
75+
}
76+
#endif
77+
78+
ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack
79+
}
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
/******************************************************************************
2+
* @file startup_ARMCM3.c
3+
* @brief CMSIS-Core(M) Device Startup File for a Cortex-M3 Device
4+
* @version V2.0.3
5+
* @date 31. March 2020
6+
******************************************************************************/
7+
/*
8+
* Copyright (c) 2009-2020 Arm Limited. All rights reserved.
9+
*
10+
* SPDX-License-Identifier: Apache-2.0
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the License); you may
13+
* not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
20+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
#if defined (ARMCM3)
26+
#include "ARMCM3.h"
27+
#else
28+
#error device not specified!
29+
#endif
30+
31+
/*----------------------------------------------------------------------------
32+
External References
33+
*----------------------------------------------------------------------------*/
34+
extern uint32_t __INITIAL_SP;
35+
36+
extern __NO_RETURN void __PROGRAM_START(void);
37+
38+
/*----------------------------------------------------------------------------
39+
Internal References
40+
*----------------------------------------------------------------------------*/
41+
__NO_RETURN void Reset_Handler (void);
42+
void Default_Handler(void);
43+
44+
/*----------------------------------------------------------------------------
45+
Exception / Interrupt Handler
46+
*----------------------------------------------------------------------------*/
47+
/* Exceptions */
48+
void NMI_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
49+
void HardFault_Handler (void) __attribute__ ((weak));
50+
void MemManage_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
51+
void BusFault_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
52+
void UsageFault_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
53+
void SVC_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
54+
void DebugMon_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
55+
void PendSV_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
56+
void SysTick_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
57+
58+
void Interrupt0_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
59+
void Interrupt1_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
60+
void Interrupt2_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
61+
void Interrupt3_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
62+
void Interrupt4_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
63+
void Interrupt5_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
64+
void Interrupt6_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
65+
void Interrupt7_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
66+
void Interrupt8_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
67+
void Interrupt9_Handler (void) __attribute__ ((weak, alias("Default_Handler")));
68+
69+
70+
/*----------------------------------------------------------------------------
71+
Exception / Interrupt Vector table
72+
*----------------------------------------------------------------------------*/
73+
74+
#if defined ( __GNUC__ )
75+
#pragma GCC diagnostic push
76+
#pragma GCC diagnostic ignored "-Wpedantic"
77+
#endif
78+
79+
extern const VECTOR_TABLE_Type __VECTOR_TABLE[240];
80+
const VECTOR_TABLE_Type __VECTOR_TABLE[240] __VECTOR_TABLE_ATTRIBUTE = {
81+
(VECTOR_TABLE_Type)(&__INITIAL_SP), /* Initial Stack Pointer */
82+
Reset_Handler, /* Reset Handler */
83+
NMI_Handler, /* -14 NMI Handler */
84+
HardFault_Handler, /* -13 Hard Fault Handler */
85+
MemManage_Handler, /* -12 MPU Fault Handler */
86+
BusFault_Handler, /* -11 Bus Fault Handler */
87+
UsageFault_Handler, /* -10 Usage Fault Handler */
88+
0, /* Reserved */
89+
0, /* Reserved */
90+
0, /* Reserved */
91+
0, /* Reserved */
92+
SVC_Handler, /* -5 SVC Handler */
93+
DebugMon_Handler, /* -4 Debug Monitor Handler */
94+
0, /* Reserved */
95+
PendSV_Handler, /* -2 PendSV Handler */
96+
SysTick_Handler, /* -1 SysTick Handler */
97+
98+
/* Interrupts */
99+
Interrupt0_Handler, /* 0 Interrupt 0 */
100+
Interrupt1_Handler, /* 1 Interrupt 1 */
101+
Interrupt2_Handler, /* 2 Interrupt 2 */
102+
Interrupt3_Handler, /* 3 Interrupt 3 */
103+
Interrupt4_Handler, /* 4 Interrupt 4 */
104+
Interrupt5_Handler, /* 5 Interrupt 5 */
105+
Interrupt6_Handler, /* 6 Interrupt 6 */
106+
Interrupt7_Handler, /* 7 Interrupt 7 */
107+
Interrupt8_Handler, /* 8 Interrupt 8 */
108+
Interrupt9_Handler /* 9 Interrupt 9 */
109+
/* Interrupts 10 .. 223 are left out */
110+
};
111+
112+
#if defined ( __GNUC__ )
113+
#pragma GCC diagnostic pop
114+
#endif
115+
116+
/*----------------------------------------------------------------------------
117+
Reset Handler called on controller reset
118+
*----------------------------------------------------------------------------*/
119+
__NO_RETURN void Reset_Handler(void)
120+
{
121+
SystemInit(); /* CMSIS System Initialization */
122+
__PROGRAM_START(); /* Enter PreMain (C library entry point) */
123+
}
124+
125+
126+
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
127+
#pragma clang diagnostic push
128+
#pragma clang diagnostic ignored "-Wmissing-noreturn"
129+
#endif
130+
131+
/*----------------------------------------------------------------------------
132+
Hard Fault Handler
133+
*----------------------------------------------------------------------------*/
134+
void HardFault_Handler(void)
135+
{
136+
while(1);
137+
}
138+
139+
/*----------------------------------------------------------------------------
140+
Default Handler for Exceptions / Interrupts
141+
*----------------------------------------------------------------------------*/
142+
void Default_Handler(void)
143+
{
144+
while(1);
145+
}
146+
147+
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
148+
#pragma clang diagnostic pop
149+
#endif
150+

0 commit comments

Comments
 (0)