summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'pressure_control/firmware/remote.c')
-rw-r--r--pressure_control/firmware/remote.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/pressure_control/firmware/remote.c b/pressure_control/firmware/remote.c
index 172c5d0..d15ff99 100644
--- a/pressure_control/firmware/remote.c
+++ b/pressure_control/firmware/remote.c
@@ -225,6 +225,11 @@ static void handle_received_message(void)
case MSG_SET_DESIRED_PRESSURE: {
struct pressure_config xy, z;
+ if (!device_is_enabled()) {
+ err = MSG_ERR_BUSY;
+ goto out;
+ }
+
irq_disable();
get_pressure_config(&xy, &z);
if (rx_msg.setpressure.island == 0)
@@ -238,6 +243,11 @@ static void handle_received_message(void)
case MSG_SET_HYSTERESIS: {
struct pressure_config xy, z;
+ if (!device_is_enabled()) {
+ err = MSG_ERR_BUSY;
+ goto out;
+ }
+
irq_disable();
get_pressure_config(&xy, &z);
if (rx_msg.setpressure.island == 0)
@@ -252,6 +262,11 @@ static void handle_received_message(void)
struct pressure_config xy, z;
bool flag;
+ if (!device_is_enabled()) {
+ err = MSG_ERR_BUSY;
+ goto out;
+ }
+
irq_disable();
get_pressure_config(&xy, &z);
flag = !!(rx_msg.setconfig.flags & (1 << CFG_FLAG_AUTOADJUST_ENABLE));
@@ -276,6 +291,11 @@ static void handle_received_message(void)
struct pressure_config xy, z;
struct valves *v;
+ if (!device_is_enabled()) {
+ err = MSG_ERR_BUSY;
+ goto out;
+ }
+
get_pressure_config(&xy, &z);
if (rx_msg.valve.island == 0) {
if (xy.autoadjust_enable) {
bues.ch cgit interface