+static void process_packet(void)
+{
+ uint cmd = get_u32_be(rx_packet);
+ uint arg = get_u32_be(rx_packet+4);
+ debug_printf("<< cmd %08x %08x\n", cmd, arg);
+
+ memset(tx_packet, 0, sizeof(tx_packet));
+ put_u32_be(tx_packet, 1);
+
+ switch (cmd)
+ {
+ case 1:
+ if (arg < 16)
+ {
+ if (arg & 1)
+ LL_GPIO_ResetOutputPin(SSR1_GPIO_Port, SSR1_Pin);
+ else
+ LL_GPIO_SetOutputPin(SSR1_GPIO_Port, SSR1_Pin);
+ if (arg & 2)
+ LL_GPIO_ResetOutputPin(SSR2_GPIO_Port, SSR2_Pin);
+ else
+ LL_GPIO_SetOutputPin(SSR2_GPIO_Port, SSR2_Pin);
+ if (arg & 4)
+ LL_GPIO_ResetOutputPin(SSR3_GPIO_Port, SSR3_Pin);
+ else
+ LL_GPIO_SetOutputPin(SSR3_GPIO_Port, SSR3_Pin);
+ if (arg & 8)
+ LL_GPIO_ResetOutputPin(SSR4_GPIO_Port, SSR4_Pin);
+ else
+ LL_GPIO_SetOutputPin(SSR4_GPIO_Port, SSR4_Pin);
+ put_u32_be(tx_packet, 0);
+ }
+ break;
+ }
+
+ debug_printf(">> status %08x\n", get_u32_be(tx_packet));
+}
+