diff --git a/latest/Firmware/.cproject b/latest/Firmware/.cproject
index deaa647..0c182ed 100644
--- a/latest/Firmware/.cproject
+++ b/latest/Firmware/.cproject
@@ -67,7 +67,7 @@
-
+
@@ -328,6 +328,7 @@
+
@@ -408,7 +409,7 @@
-
+
@@ -744,7 +745,7 @@
-
+
@@ -1092,7 +1093,7 @@
-
+
diff --git a/latest/Firmware/Inc/CircularQueue.hpp b/latest/Firmware/Inc/CircularQueue.hpp
index 743e5de..3373081 100644
--- a/latest/Firmware/Inc/CircularQueue.hpp
+++ b/latest/Firmware/Inc/CircularQueue.hpp
@@ -38,7 +38,7 @@ public:
ASSERT(mBuffer);
}
- bool empty()
+ inline bool empty()
{
return mReadPosition == mWritePosition;
}
@@ -61,16 +61,14 @@ public:
if ( empty() )
return false;
- int nextElement = (mReadPosition + 1) % mSize;
-
Element = mBuffer[mReadPosition];
- mReadPosition = nextElement;
+ mReadPosition = (mReadPosition + 1) % mSize;
return true;
}
private:
- bool isSafeToWrite(int nextElement)
+ inline bool isSafeToWrite(int nextElement)
{
return nextElement != mReadPosition;
}
@@ -79,7 +77,7 @@ private:
volatile int mReadPosition;
volatile int mWritePosition;
size_t mSize;
- T* mBuffer;
+ volatile T* mBuffer;
};
#endif /* CIRCULARQUEUE_HPP_ */
diff --git a/latest/Firmware/Inc/FreeRTOSConfig.h b/latest/Firmware/Inc/FreeRTOSConfig.h
index 3ca3d18..e0cb6fd 100644
--- a/latest/Firmware/Inc/FreeRTOSConfig.h
+++ b/latest/Firmware/Inc/FreeRTOSConfig.h
@@ -67,12 +67,12 @@
#define configTOTAL_HEAP_SIZE ((size_t)16384)
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_16_BIT_TICKS 0
-#define configUSE_MUTEXES 1
+#define configUSE_MUTEXES 0
#define configQUEUE_REGISTRY_SIZE 8
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configCHECK_FOR_STACK_OVERFLOW 0
-#define configUSE_TIMERS 1
+#define configUSE_TIMERS 0
#define configTIMER_TASK_PRIORITY ( 2 )
#define configTIMER_QUEUE_LENGTH 10
#define configTIMER_TASK_STACK_DEPTH 256
diff --git a/latest/Firmware/Inc/bsp/bsp.hpp b/latest/Firmware/Inc/bsp/bsp.hpp
index e121c92..7ce78b9 100644
--- a/latest/Firmware/Inc/bsp/bsp.hpp
+++ b/latest/Firmware/Inc/bsp/bsp.hpp
@@ -47,6 +47,8 @@ void bsp_gnss_on();
void bsp_gnss_off();
bool bsp_is_tx_disabled();
uint8_t bsp_noise_floor();
+void bsp_signal_high();
+void bsp_signal_low();
// Callback for processing UART input (interrupt)
typedef void(*char_input_cb)(char c);
diff --git a/latest/Firmware/Inc/bsp/bsp_6_1.hpp b/latest/Firmware/Inc/bsp/bsp_6_1.hpp
index cc92dc2..b0f9e1b 100644
--- a/latest/Firmware/Inc/bsp/bsp_6_1.hpp
+++ b/latest/Firmware/Inc/bsp/bsp_6_1.hpp
@@ -68,6 +68,9 @@
#define UART_RX_PORT GPIOA
#define UART_RX_PIN GPIO_PIN_10
+#define SPARE_PORT GPIOA
+#define SPARE_PIN GPIO_PIN_11
+
#define TX_DISABLE_PORT GPIOA
#define TX_DISABLE_PIN GPIO_PIN_12
diff --git a/latest/Firmware/Src/EventQueue.cpp b/latest/Firmware/Src/EventQueue.cpp
index 31b2fe9..9016767 100644
--- a/latest/Firmware/Src/EventQueue.cpp
+++ b/latest/Firmware/Src/EventQueue.cpp
@@ -19,7 +19,7 @@
#include "EventQueue.hpp"
-#include
+//#include
#include "printf_serial.h"
#include "printf_serial.h"
@@ -27,8 +27,9 @@
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
+#include "bsp.hpp"
-#define EVENT_QUEUE_SIZE 40
+#define EVENT_QUEUE_SIZE 50
static Event __queue[EVENT_QUEUE_SIZE];
@@ -53,12 +54,16 @@ void EventQueue::push(const Event &e)
if ( xTaskGetSchedulerState() != taskSCHEDULER_RUNNING )
return;
- BaseType_t xHighPriorityTaskWoken = pdFALSE;
+ BaseType_t xHighPriorityTaskWoken = pdTRUE;
if ( Utils::inISR() )
{
+ //bsp_signal_high();
xQueueSendFromISR(mQueueHandle, &e, &xHighPriorityTaskWoken);
+ //bsp_signal_low();
+#if 0
if ( xHighPriorityTaskWoken )
portYIELD_FROM_ISR(xHighPriorityTaskWoken);
+#endif
}
else
{
diff --git a/latest/Firmware/Src/bsp/bsp_6_1.cpp b/latest/Firmware/Src/bsp/bsp_6_1.cpp
index 66f1d05..a574f58 100644
--- a/latest/Firmware/Src/bsp/bsp_6_1.cpp
+++ b/latest/Firmware/Src/bsp/bsp_6_1.cpp
@@ -53,7 +53,8 @@ typedef struct
} GPIO;
static const GPIO __gpios[] = {
- {GNSS_EN_PORT, {GNSS_EN_PIN, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_SET},
+ {GNSS_EN_PORT, {GNSS_EN_PIN, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_RESET},
+ {SPARE_PORT, {SPARE_PIN, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_HIGH, 0}, GPIO_PIN_RESET},
{TX_DISABLE_PORT, {TX_DISABLE_PIN, GPIO_MODE_INPUT, GPIO_PULLUP, GPIO_SPEED_LOW, 0}, GPIO_PIN_SET},
{EEPROM_WREN_PORT, {EEPROM_WREN_PIN, GPIO_MODE_OUTPUT_OD, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_SET},
{CS2_PORT, {CS2_PIN, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_HIGH, 0}, GPIO_PIN_SET},
@@ -564,6 +565,16 @@ uint8_t bsp_noise_floor()
return 0x22;
}
+void bsp_signal_high()
+{
+ HAL_GPIO_WritePin(SPARE_PORT, SPARE_PIN, GPIO_PIN_SET);
+}
+
+void bsp_signal_low()
+{
+ HAL_GPIO_WritePin(SPARE_PORT, SPARE_PIN, GPIO_PIN_RESET);
+}
+
extern "C"
{