Formatted amsat/ to final coding guidelines

pull/1/head
Nate Bargmann 2017-10-08 07:08:53 -05:00
rodzic 62309abd49
commit 708ca78c77
1 zmienionych plików z 48 dodań i 37 usunięć

Wyświetl plik

@ -26,11 +26,12 @@
#include <stdlib.h>
#include <string.h> /* String function definitions */
#include <unistd.h> /* UNIX standard function definitions */
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#include "hamlib/rotator.h"
#include <hamlib/rotator.h>
#include "parallel.h"
#include "misc.h"
#include "register.h"
@ -61,22 +62,32 @@ if100_set_position(ROT *rot, azimuth_t az, elevation_t el)
#define CLK 0x02
#define TRACK 0x08
rig_debug(RIG_DEBUG_TRACE, "%s: shifting dataout 0x%04x to parallel port\n", __func__, dataout);
rig_debug(RIG_DEBUG_TRACE,
"%s: shifting dataout 0x%04x to parallel port\n",
__func__, dataout);
retval = par_lock(port);
if (retval != RIG_OK)
return retval;
for (i = 0; i < 16; i++) {
if (dataout & 0x8000) {
if (retval != RIG_OK)
{
return retval;
}
for (i = 0; i < 16; i++)
{
if (dataout & 0x8000)
{
par_write_data(port, TRACK | DAT0);
par_write_data(port, TRACK | DAT0 | CLK);
par_write_data(port, TRACK | DAT0);
} else {
}
else
{
par_write_data(port, TRACK);
par_write_data(port, TRACK | CLK);
par_write_data(port, TRACK);
}
dataout = (dataout << 1) & 0xffff;
}
@ -89,7 +100,8 @@ if100_set_position(ROT *rot, azimuth_t az, elevation_t el)
/** IF-100 implements essentially only the set position function.
*/
const struct rot_caps if100_rot_caps = {
const struct rot_caps if100_rot_caps =
{
.rot_model = ROT_MODEL_IF100,
.model_name = "IF-100",
.mfg_name = "AMSAT",
@ -122,4 +134,3 @@ DECLARE_INITROT_BACKEND(amsat)
return RIG_OK;
}