Fix for issue 180: Added CU,3,1/CU,3,0 to turn on/off the red LED acting as a 'FIFO empty' indicator. Also bumped version to 2.8.1

pull/181/head
EmbeddedMan 2022-07-26 21:53:48 -05:00
rodzic 6d9b5ce185
commit c5f6a3163c
7 zmienionych plików z 6387 dodań i 19 usunięć

Wyświetl plik

@ -108,6 +108,7 @@
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeUseCleanTarget>false</makeUseCleanTarget>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>
@ -267,6 +268,7 @@
</compileType>
<makeCustomizationType>
<makeCustomizationPreStepEnabled>false</makeCustomizationPreStepEnabled>
<makeUseCleanTarget>false</makeUseCleanTarget>
<makeCustomizationPreStep></makeCustomizationPreStep>
<makeCustomizationPostStepEnabled>false</makeCustomizationPostStepEnabled>
<makeCustomizationPostStep></makeCustomizationPostStep>

Wyświetl plik

@ -4,14 +4,9 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/UBW.h</file>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/UBW.c</file>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/ebb.h</file>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/RCServo2.h</file>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/HardwareProfile_EBB_V13_and_above.h</file>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/ebb.c</file>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/RCServo2.c</file>
<file>file:/D:/Projects/EggBot5-GH/EBB_firmware/app.X/source/main.c</file>
<file>file:/D:/Projects/EggBot1-GH/EBB_firmware/app.X/source/UBW.c</file>
<file>file:/D:/Projects/EggBot1-GH/EBB_firmware/app.X/source/ebb.c</file>
<file>file:/D:/Projects/EggBot1-GH/EBB_firmware/app.X/source/HardwareProfile_EBB_V13_and_above.h</file>
</group>
</open-files>
</project-private>

Wyświetl plik

@ -158,7 +158,7 @@ const rom char st_LFCR[] = {"\r\n"};
#elif defined(BOARD_EBB_V12)
const rom char st_version[] = {"EBBv12 EB Firmware Version 2.2.1\r\n"};
#elif defined(BOARD_EBB_V13_AND_ABOVE)
const rom char st_version[] = {"EBBv13_and_above EB Firmware Version 2.8.0\r\n"};
const rom char st_version[] = {"EBBv13_and_above EB Firmware Version 2.8.1\r\n"};
#elif defined(BOARD_UBW)
const rom char st_version[] = {"UBW EB Firmware Version 2.2.1\r\n"};
#endif
@ -227,6 +227,9 @@ unsigned int gPulseCounters[4] = {0,0,0,0};
volatile UINT32 gRCServoPoweroffCounterMS = 0;
volatile UINT32 gRCServoPoweroffCounterReloadMS = RCSERVO_POWEROFF_DEFAULT_MS;
// When true, red LED will light when FIFO is empty
volatile BOOL gRedLEDEmptyFIFO = FALSE;
/** P R I V A T E P R O T O T Y P E S ***************************************/
void BlinkUSBStatus (void); // Handles blinking the USB status LED
BOOL SwitchIsPressed (void); // Check to see if the user (PRG) switch is pressed
@ -1601,7 +1604,9 @@ void parse_R_packet(void)
// CU is "Configure UBW" and controls system-wide configuration values
// "CU,<parameter_number>,<parameter_value><CR>"
// <parameter_number> <parameter_value>
// 1 {1|0} turns on or off the 'ack' ("OK" at end of packets)
// 1 {1|0} turns on or off the 'ack' ("OK" at end of packets)
// 2 {1|0} turns on or off parameter limit checking (defaults to on))
// 3 {1|0} turns on or off the red LED acting as an empty FIFO indicator (defaults to off)
void parse_CU_packet(void)
{
unsigned char parameter_number;
@ -1627,17 +1632,29 @@ void parse_CU_packet(void)
bitset (error_byte, kERROR_BYTE_PARAMETER_OUTSIDE_LIMIT);
}
}
if (2 == parameter_number)
else if (2 == parameter_number)
{
if (0 == paramater_value || 1 == paramater_value)
{
if (0 == paramater_value || 1 == paramater_value)
{
gLimitChecks = paramater_value;
}
else
{
bitset (error_byte, kERROR_BYTE_PARAMETER_OUTSIDE_LIMIT);
}
gLimitChecks = paramater_value;
}
else
{
bitset (error_byte, kERROR_BYTE_PARAMETER_OUTSIDE_LIMIT);
}
}
else if (3 == parameter_number)
{
if (0 == paramater_value || 1 == paramater_value)
{
gRedLEDEmptyFIFO = paramater_value;
mLED_2_Off()
}
else
{
bitset (error_byte, kERROR_BYTE_PARAMETER_OUTSIDE_LIMIT);
}
}
print_ack();
}

Wyświetl plik

@ -135,6 +135,8 @@ extern volatile tRC_state g_RC_state[kRC_DATA_SIZE];
extern volatile unsigned long int gRCServoPoweroffCounterMS;
extern volatile unsigned long int gRCServoPoweroffCounterReloadMS;
extern volatile BOOL gRedLEDEmptyFIFO;
/** P U B L I C P R O T O T Y P E S *****************************************/
void UserInit (void);
void ProcessIO (void);

Wyświetl plik

@ -264,6 +264,7 @@
// Issue 153: Add optional parameter to ES command to disable
// motors.
// Fix bug in ES command that didn't send return packet
// 2.8.1 07/26/22 - Issue 180: Add CU,3,1 to turn on RED LED reporting of FIFO empty
#include <p18cxxx.h>
#include <usart.h>
@ -802,6 +803,10 @@ void high_ISR(void)
CurrentCommand.Command = COMMAND_NONE;
if (!FIFOEmpty)
{
if (gRedLEDEmptyFIFO)
{
mLED_2_Off()
}
#if defined(GPIO_DEBUG)
TRISDbits.TRISD0 = 0;
LATDbits.LATD0 = 1;
@ -864,6 +869,11 @@ void high_ISR(void)
else
{
CurrentCommand.DelayCounter = 0;
if (gRedLEDEmptyFIFO)
{
mLED_2_On()
}
#if defined(GPIO_DEBUG)
TRISAbits.TRISA1 = 0;
LATAbits.LATA1 = 1;