What a format for sprintf need to use for print array?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

I want to print array of this structure : 

   

typedef struct
{
    uint32 time;
    uint32 date;
    uint32 dayOfWeek;
    uint32 status;
}Timer_DATE_TIME;

   

What a format for sprintf need to use ?

   

sprintf(stringBuffer, "%??\r\n",  timeData );
UART_UartPutString(stringBuffer);

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You will have to print the elements of the struct or the members of the array step by step, no chance to print as a single item.

   

 

   

Bob

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You will have to print the elements of the struct or the members of the array step by step, no chance to print as a single item.

   

 

   

Bob

0 Likes
urchc_1533771
Level 5
Level 5
5 likes given First like received First like given

In SKILL I use I can make print entire list :
(prop nil bBox ((13063.0 3402.5) (13357.5 3702.5)) readOnly t pins (dbid:360332064 dbid:360331984) objType "symbol" embeddedAttach nil embeddedMethod nil embeddedLayer nil embedded nil fixedByTestPoint nil component dbid:357473208 xy (13225.0 3555.0) type "PACKAGE" rotation 270.0 refdes "D26" parent dbid:278137888 name "SMB_CP" definition dbid:357533128 mirrorType "NO" isMirrored nil etchChildren nil children (dbid:360924432 dbid:360924512 dbid:360811176 dbid:360924704 dbid:360924592 dbid:360924648 dbid:360924960 dbid:360925032 dbid:360925104 dbid:360925176 dbid:360925248 dbid:360925320 dbid:360925392 dbid:360925464 dbid:360925536 dbid:360925608 dbid:360925680 dbid:360925752) parentGroups nil)

   

that include all properties of object with different types...

   

Nothing like this ?? Very bad 😞

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

PSoCs are programmed in C, and C is not a high-level language. Apart from that, a small 'for'-loop with a printf-statement in it seems much easier than the code you pasted here 🙂