You are here

Variable types to pass into UART PutArray | Cypress Semiconductor

Variable types to pass into UART PutArray

Summary: 1 Reply, Latest post by Bob Marlowe on 27 Nov 2014 11:58 PM PST
Verified Answers: 0
Last post
Log in to post new comments.
user_343349849's picture
314 posts

 I am having a bit of trouble calling PutArray.

My data buffer is an element in a struct and it has type    uint8  Buf[];

When I call  COM_PutArray(COM.Buf,NumBytes);

I get warning it is wanting type const uint8 passed. I am not sure what I need to do here as I don't think it makes sense to cast as a "const" ?

I am wanting a blocking function so program waits will last btyre sent before progressing.


user_1377889's picture
9284 posts

The typecast to const will not swallow any additional instructions to perform, but could advise the optimizer to save some. It ensures that the parameter will not be changed by the called function.


Another point is "blocking": PutArray() does not wait until the bytes are transmitted, it only waits for room in the buffer to have the bytes copied. So when the function returns the transmition is still active driven by interrupt.



Log in to post new comments.