From 2e1baad3b61dfcb05e9df506eb120f0d377affa0 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Wed, 2 Aug 2023 00:17:55 +0200 Subject: [PATCH 1/2] Add missing _exit symbol Signed-off-by: Christophe de Dinechin --- dmcp/sys/pgm_syscalls.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dmcp/sys/pgm_syscalls.c b/dmcp/sys/pgm_syscalls.c index e6275c8..e55b0e7 100644 --- a/dmcp/sys/pgm_syscalls.c +++ b/dmcp/sys/pgm_syscalls.c @@ -31,9 +31,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - The software and related material is released as “NOMAS” (NOt MAnufacturer Supported). + The software and related material is released as “NOMAS” (NOt MAnufacturer Supported). - 1. Info is released to assist customers using, exploring and extending the product + 1. Info is released to assist customers using, exploring and the product 2. Do NOT contact the manufacturer with questions, seeking support, etc. regarding NOMAS material as no support is implied or committed-to by the Manufacturer 3. The Manufacturer may reply and/or update materials if and when needed solely @@ -190,3 +190,10 @@ void post_main() { sys_reset(); } + +void __attribute__((__noreturn__)) _exit(int status) +{ + set_reset_magic(RUN_DMCP_MAGIC); + sys_reset(); + while(1); +} From 91cb47248cf9008b8f71fa8286eb02d86ad577f7 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Mon, 7 Aug 2023 23:41:09 +0200 Subject: [PATCH 2/2] Make header compatible with C++ Signed-off-by: Christophe de Dinechin --- dmcp/dmcp.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dmcp/dmcp.h b/dmcp/dmcp.h index 8a52674..1465d63 100644 --- a/dmcp/dmcp.h +++ b/dmcp/dmcp.h @@ -31,7 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - The software and related material is released as “NOMAS” (NOt MAnufacturer Supported). + The software and related material is released as “NOMAS” (NOt MAnufacturer Supported). 1. Info is released to assist customers using, exploring and extending the product 2. Do NOT contact the manufacturer with questions, seeking support, etc. regarding @@ -45,6 +45,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + typedef unsigned int uint; #include "ff_ifc.h" @@ -192,7 +196,7 @@ int lcd_textToWidthR(disp_stat_t * ds, const char* text, int expected_width, int void lcd_writeTextWidth(disp_stat_t * ds, const char* text); // Get text which fits in expected width *without breaking words* -// - word could be broken in the middle only when is placed single long word on line +// - word could be broken in the middle only when is placed single long word on line int lcd_textForWidth(disp_stat_t * ds, const char* text, int expected_width, int * plen); @@ -463,7 +467,7 @@ int sys_last_scan(int *k1, int *k2); ///////////////////////////////// -// Low level diagnostics +// Low level diagnostics ///////////////////////////////// void suspended_bg_key_read(); @@ -516,7 +520,7 @@ int qspi_user_size(); // ---------------------------------- -// Printer +// Printer #define PRINT_GRA_LN 1 #define PRINT_TXT_LN 0 @@ -816,7 +820,7 @@ int run_menu_item_sys(uint8_t line_id); #define VAL_ST(x) VAL(x,calc_state) #define CLR_ST(x) CLR(x,calc_state) #define SET_ST(x) SET(x,calc_state) -#define SETMSK_ST(x,m) SETMSK(x,m,calc_state) +#define SETMSK_ST(x,m) SETMSK(x,m,calc_state) #define SETBY_ST(c,x) SETBY(c,x,calc_state) @@ -934,7 +938,7 @@ int sys_timer_active(int timer_ix); int sys_timer_timeout(int timer_ix); // Millisecond delay -void sys_delay(uint32_t ms_delay); +void sys_delay(uint32_t ms_delay); // Current systick count uint32_t sys_tick_count(); @@ -1001,4 +1005,8 @@ int update_bmp_file_header(FIL* fp, int width, int height, uint32_t bg_color); #include "lft_ifc.h" +#ifdef __cplusplus +} +#endif // __cplusplus + #endif