Skip to content

Re-write the greentea_send_kv() functions to replace the use of printf,#14

Merged
PrzemekWirkus merged 1 commit intoARMmbed:masterfrom
adbridge:master
Jun 7, 2016
Merged

Re-write the greentea_send_kv() functions to replace the use of printf,#14
PrzemekWirkus merged 1 commit intoARMmbed:masterfrom
adbridge:master

Conversation

@adbridge
Copy link
Collaborator

@adbridge adbridge commented Jun 7, 2016

Description

with a set of underlying functions to write the preamble, postamble,
strings and integer values, directly to the serial port (for target to host comms)
using the Rawserial class. Raw serial can be used safely from
within an interrupt context, whereas printf cannot. Thus this change
allows key/values to be written to the host from within interrupt context.

Added instantiation of the Rawserial class, greentea_serial
Added new functions:

  • greentea_write_preamble()
  • greentea_write_postamble()
  • greentea_write_string()
  • greentea_write_int()

This is an internal change only within greentea-client and does not affect
the user use of greentea_send_kv().

with a set of underlying functions to write the preamble, postamble,
strings and integer values, directly to the serial port (for target to host comms)
using the mbed-os Rawserial class. Raw serial can be used safely from
within and interrupt context, whereas printf cannot. Thus this change
allows key/values to be written to the host from within interrupt context.

Added instantiation of the Rawserial class, greentea_serial
Added new functions:
greentea_write_preamble()
greentea_write_postamble()
greentea_write_string()
greentea_write_int()

This is an internal change only within greentea_client and does not affect
the user use of greentea_send_kv().
@adbridge
Copy link
Collaborator Author

adbridge commented Jun 7, 2016

@PrzemekWirkus @mazimkhan please review

* \param val - integer value
*
*/
#define MAX_INT_STRING_LEN 15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const int MAX_INT_STRING_LEN = 16;

@PrzemekWirkus
Copy link
Contributor

+1

@PrzemekWirkus
Copy link
Contributor

@0xc0170 Can you check if we are using RAWSerial "the right way"?

@PrzemekWirkus
Copy link
Contributor

@0xc0170 I will merge this PR but if you have any doubts, please let me know :)

@PrzemekWirkus PrzemekWirkus merged commit 949c9ba into ARMmbed:master Jun 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants