Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of byte swapping macro #23

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fsw/platform_inc/tvs_io_platform_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ static const int TVS_SERVER_PORTS[TVS_NUM_SIM_CONN] = {17000, 17001};

#define TVS_IO_FRAME_DATA_BUFFER_SIZE 81920 // 80 kB default - can be tuned up or down based on data rate per frame

/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* Caution: The byte swap implementation below is expermental! */
/* This will only byte swap data coming FROM trick (flowDirection 1) */
#define TVS_BYTE_SWAP false // Set to true to byte swap, use at your own risk
#define TVS_SET_BYTE_SWAP_CMD "trick.var_byteswap(1)\n"
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */

#endif /* _TVS_IO_PLATFORM_CFG_H_ */

/*=======================================================================================
Expand Down
4 changes: 4 additions & 0 deletions fsw/src/tvs_io_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ int32 SendInitMessages()
{
SendTvsMessage(conn, TVS_PAUSE_CMD);
SendTvsMessage(conn, TVS_SET_BINARY_NO_NAMES);
#if(TVS_BYTE_SWAP) // Caution! Experimental, use at your own risk!
// trick variable server will byte swap data before sending to tvsio, enable in tvs_io_platform_cfg.h
SendTvsMessage(conn, TVS_SET_BYTE_SWAP_CMD);
#endif
SendTvsMessage(conn, TVS_SET_COPY_MODE_CMD);
SendTvsMessage(conn, TVS_SET_WRITE_MODE_CMD);
}
Expand Down