Adding older Typedef to True studio

Discussions concerning TrueSTUDIO for STM32 9.0.0 and later versions.

Moderators: Markus Girdland, Mattias Norlander

conradc2380
Posts: 1
Joined: Thu Jan 10, 2019 8:18 pm

Adding older Typedef to True studio

Postby conradc2380 » Thu Jan 10, 2019 8:29 pm

Hi ,

Hope someone can help me here .

I am trying to add the following typedef implementation into truestudio, because quite a lot of my older code was built in coocox and i would like to re use it with Attolic. The Problem i am experiencing is that u8,u16 and u32 typedefs are not supported, also i noticed if a uint8_t type is used in a H file the compiler also don recognize the variable , but it only recognizes the standard int and char types in the H files .

typedef long unsigned int u32;
typedef short unsigned int u16;
typedef unsigned char u8;

i added the above to the default system file _default_types.h ,but this did not solve the problem either .

Has anyone looked at this before ?

regards
Conrad

User avatar
artbody
Posts: 18
Joined: Tue Jan 01, 2019 7:07 pm
Location: Germany
Contact:

Re: Adding older Typedef to True studio

Postby artbody » Sun Jan 13, 2019 1:17 pm

normaly you need

Code: Select all

#include <stdint.h>
#include <stdbool.h>

then you can define what ever you need

Code: Select all

// same file
#define sc_string      char*
 
typedef bool         sc_boolean;
typedef int_fast16_t   sc_short;
typedef uint_fast16_t   sc_ushort;
typedef int32_t         sc_integer;
typedef uint32_t      sc_uinteger;

typedef double         sc_real;

typedef void*         sc_eventid;

typedef intptr_t      sc_intptr_t;

...
Linux artbody 4.14.83-gentoo #1 SMP Mon Dec 3 23:46:25 CET 2018 x86_64 AMD FX(tm)-8350 Eight-Core Processor AuthenticAMD GNU/Linux
:mrgreen:


Return to “TrueSTUDIO for STM32 discussions”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest