Skip to content

Commit

Permalink
Merge pull request #22 from SenteraLLC/release-1.1.0
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
jonrwat committed Sep 18, 2015
2 parents 203f89e + 92655de commit 37fb64e
Show file tree
Hide file tree
Showing 7 changed files with 2,353 additions and 2,133 deletions.
45 changes: 44 additions & 1 deletion http/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,25 @@
document.getElementById('cfgResp').value = "";
}

function testModeAction()
{
// Only enabled the CAN Servo-Node Test "Send" button if "Test"
// mode is selected.
if (document.getElementById('testMode').value === "1")
{
document.getElementById('testButton').disabled = false;
}
else
{
document.getElementById('testButton').disabled = true;
}

// Issue command to server to identify operation state.
newAJAXCommand('buttons.cgi?button=sendModeValue' +
'&mode=' + document.getElementById('testMode').value.toString() +
'&timestamp=' + (new Date()).getTime());
}

// Action for sending a test value.
function testValueAction()
{
Expand Down Expand Up @@ -594,6 +613,30 @@
 
</td>
</tr>
<tr>
<td style="text-align: left">
<b>Mode*</b>
</td>
<td style="text-align: center">
<select name="testMode" id="testMode" onchange="testModeAction()">
<option value="0">Normal</option>
<option value="1">Test</option>
</select>
</td>
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td style="text-align: left" colspan="4">
<p><b>*</b>Setting the mode to <i>Test</i> inhibits the FMU from processing BeagleBone and RC servo commands. Return the mode to <i>Normal</i> before closing this browser to resume normal operation.</p>
</td>
</tr>
<tr>
<td colspan="4">
&nbsp;
</td>
</tr>
<tr>
<td style="text-align: right">
<b>ID</b>
Expand Down Expand Up @@ -623,7 +666,7 @@
</select>
</td>
<td style="text-align: center">
<button type="button" style="width: 50px" onclick="testValueAction()">send</button>
<button id="testButton" type="button" style="width: 50px" onclick="testValueAction()" disabled="disabled">send</button>
</td>
</tr>
</table>
Expand Down
14 changes: 14 additions & 0 deletions inc/snode.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ typedef struct
////////////////////////////////////////////////////////////////////////////////
void SNodeTask( void );

////////////////////////////////////////////////////////////////////////////////
/// @brief Set Intrusive Control Mode(ICM).
///
/// @param icm
/// Status of intrusive contorl:
/// true - intrusive control is enabled.
/// false - intrusive control is disabled.
///
/// This function enabled/disables intrusive control. During intrusive control,
/// the normal operation of sending Control Surface Command messages is
/// inhibited.
////////////////////////////////////////////////////////////////////////////////
void SNodeICMSet( bool icm );

////////////////////////////////////////////////////////////////////////////////
/// @brief Set Servo-Node calibration write.
///
Expand Down
7 changes: 3 additions & 4 deletions nbproject/configurations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
</PICkit3PlatformTool>
<RealICEPlatformTool>
<property key="ADC 1" value="true"/>
<property key="AutoSelectMemRanges" value="auto"/>
<property key="AutoSelectMemRanges" value="manual"/>
<property key="CAN1" value="true"/>
<property key="CAN2" value="true"/>
<property key="CHANGE NOTICE" value="true"/>
Expand Down Expand Up @@ -398,7 +398,6 @@
<property key="UART5" value="true"/>
<property key="UART6" value="true"/>
<property key="debugoptions.useswbreakpoints" value="false"/>
<property key="firmware.download.all" value="false"/>
<property key="hwtoolclock.frcindebug" value="false"/>
<property key="hwtoolclock.instructionspeed" value="4"/>
<property key="hwtoolclock.units" value="mips"/>
Expand All @@ -423,8 +422,8 @@
<property key="programoptions.eraseb4program" value="true"/>
<property key="programoptions.preservedataflash" value="false"/>
<property key="programoptions.preserveeeprom" value="false"/>
<property key="programoptions.preserveprogramrange" value="false"/>
<property key="programoptions.preserveprogramrange.end" value="0x1d07ffff"/>
<property key="programoptions.preserveprogramrange" value="true"/>
<property key="programoptions.preserveprogramrange.end" value="0x1d0001ff"/>
<property key="programoptions.preserveprogramrange.start" value="0x1d000000"/>
<property key="programoptions.preserveuserid" value="false"/>
<property key="programoptions.programcalmem" value="false"/>
Expand Down
25 changes: 21 additions & 4 deletions src/snode.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,26 @@ typedef struct
static SNODE_RX_DATA snode_rx_data_buf[ SNODE_RX_BUF_SIZE ];
static SNODE_RX_DATA* snode_rx_data_id_p[ 128 ] = { 0 };

SNODE_WRITE_ID_DATA snode_write_id_data =
static SNODE_WRITE_ID_DATA snode_write_id_data =
{
.status = SNODE_ID_WRITE_SUCCESS,
};

SNODE_WRITE_CAL_DATA snode_write_cal_data =
static SNODE_WRITE_CAL_DATA snode_write_cal_data =
{
.status = SNODE_CAL_WRITE_SUCCESS,
};

SNODE_READ_CAL_DATA snode_read_cal_data =
static SNODE_READ_CAL_DATA snode_read_cal_data =
{
.status = SNODE_CAL_READ_SUCCESS,
};

// Intrusive Control Mode (ICM) status. Value is initialized to 'false' to
// perform normal operation on reset.
//
static bool snode_icm = false;

// *****************************************************************************
// ************************** Function Prototypes ******************************
// *****************************************************************************
Expand All @@ -130,14 +135,26 @@ void SNodeTask( void )
{
// Host <-> FMU <-> Servo-Node communication tasks.
SNodeCtrlDataTask();
SNodeCtrlCmdTask();

// Servo-Node is not being intrusively controlled ?
if( snode_icm == false )
{
// Perform normal operation of constructing and sending the
// controller commands.
SNodeCtrlCmdTask();
}

// Web <-> FMU <-> Servo-Node communication tasks.
SNodeIDWriteTask();
SNodeCalWriteTask();
SNodeCalReadTask();
}

void SNodeICMSet( bool icm )
{
snode_icm = icm;
}

void SNodeCalWriteSet( uint8_t node_id, SNODE_CFG_VAL* cfg_val_p )
{
snode_write_cal_data.status = SNODE_CAL_WRITE_IN_PROG;
Expand Down
2 changes: 1 addition & 1 deletion src/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef struct
static const uint8_t status_node_type = 0;

static const uint8_t status_fw_rev_ver = 0; ///< Firmware revision version number.
static const uint8_t status_fw_min_ver = 0; ///< Firmware minor version number.
static const uint8_t status_fw_min_ver = 1; ///< Firmware minor version number.
static const uint8_t status_fw_maj_ver = 1; ///< Firmware major version number.

static const uint8_t status_hw_rev_ver = 0; ///< Hardware revision version number.
Expand Down
19 changes: 19 additions & 0 deletions src/tcpip/custom_http_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,25 @@ HTTP_IO_RESULT HTTPExecuteGet(void)

SNodeCalReadSet( id );
}
else if (strcmp((const char*)ptr, "sendModeValue") == 0)
{
uint8_t *cmdPtr;
uint8_t mode;

cmdPtr = HTTPGetROMArg(curHTTP.data, (ROM uint8_t *)"mode");
mode = atoi((char*)cmdPtr);

// Test mode ?
if(mode == 1)
{
SNodeICMSet( true );
}
// Normal mode.
else
{
SNodeICMSet( false );
}
}
else if (strcmp((const char*)ptr, "sendTestValue") == 0)
{
uint8_t *cmdPtr;
Expand Down
Loading

0 comments on commit 37fb64e

Please sign in to comment.