3 Replies Latest reply on Mar 11, 2016 2:09 AM by helic_263931

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

    urchc_1533771

      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[i] );
      UART_UartPutString(stringBuffer);

        • 1. Re: What a format for sprintf need to use for print array?
          JoMe_264151

          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

          • 2. Re: What a format for sprintf need to use for print array?
            urchc_1533771

            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 :(

            • 3. Re: What a format for sprintf need to use for print array?

              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 :)

              1 of 1 people found this helpful