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

Fixes for Arch ARM #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ endif(BUILD_DOC)

# Debug/Release flags
set(CMAKE_C_FLAGS_DEBUG "-DGRFUTILS_DEBUG")
set (CMAKE_SHARED_LINKER_FLAGS "-lrt")

# Compiler flags
add_definitions("-Wall")
Expand Down
48 changes: 48 additions & 0 deletions COMPILE
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

Short overview for those who don't read manuals. This COMPILE file describes
how to compile and setup libgrf.so and grfctl

== Installation

Clone this repository:
# git clone git://github.com/DocLambda/grfutils
# cd grfutils

== Linux and FreeBSD

Make sure you have cmake and the gcc toolchain required for compilation
installed:

* Ubuntu
# sudo apt-get install build-essential cmake

* Fedora
# sudo yum install make cmake gcc gcc-c++

* FreeBSD
# pkg install cmake

Build:
# cd grfutils
# cmake .
# make

== Raspberry/Raspbian

Download and install the latest Raspbian development distribution.

Set environment:
# mkdir rtools
# cd rtools
# git clone git://github.com/raspberrypi/tools.git
# export RASPBIANSRC=PATH_TO_rtools
# export PATH=${RASPBIANSRC}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
# export CXX=${RASPBIANSRC}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/g++
# export CC=${RASPBIANSRC}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc

Build:
# cd grfutils
# cmake .
# make


2 changes: 1 addition & 1 deletion bin/grfctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int main(int argc, char **argv)
int loglevel = GRF_DEFAULT_LOGLEVEL;
int index;
int ret;
char c;
int c;

static struct option options[] =
{
Expand Down
8 changes: 4 additions & 4 deletions src/grf_radio_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ int grf_radio_write(struct grf_radio *radio, const char *message, size_t len)
len -= count;
}

if (fsync(radio->fd))
if (tcflush(radio->fd, TCOFLUSH))
{
grf_logging_err("Calling fsync on %d failed: %s", radio->fd, strerror(errno));
grf_logging_err("Calling tcflush on %d failed: %s", radio->fd, strerror(errno));
return errno;
}

Expand All @@ -450,9 +450,9 @@ int grf_radio_write_ctrl(struct grf_radio *radio, char ctrl)
if (write(radio->fd, &ctrl, sizeof(char)) < 0)
return errno;

if (fsync(radio->fd))
if (tcflush(radio->fd, TCOFLUSH))
{
grf_logging_err("Calling fsync on %d failed: %s", radio->fd, strerror(errno));
grf_logging_err("Calling tcflush on %d failed: %s", radio->fd, strerror(errno));
return errno;
}

Expand Down