Skip to content

Commit

Permalink
Bugfix for receiving non-DMX packets and flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
CShark committed Mar 6, 2023
1 parent 63dbdd0 commit 2a135d0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions DMX G441/Inc/eth/artnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "arch/cc.h"

#define ARTNET_FAILTIMEOUT 5000
#define ARTNET_FIRMWAREV 3

typedef enum {
ArtCode_OpPoll = 0x2000,
Expand Down
17 changes: 11 additions & 6 deletions DMX G441/Src/dmx_usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,19 @@ static void USART_HandleIrqResponse(USART_DmxConfig *dmx) {
dmx->Usart->CR3 &= ~USART_CR3_DMAR;
dmx->Dma->CCR &= ~DMA_CCR_EN;
dmx->Usart->ICR |= USART_ICR_FECF;
dmx->BreakStatus = 1;
} else if ((dmx->Usart->CR3 & USART_CR3_DMAR) == 0) {
// check for 0 byte
if (data == 0x00) {
dmx->Usart->CR3 |= USART_CR3_DMAR;
dmx->Dma->CMAR = dmx->DmxBuffer + 1;
dmx->Dma->CNDTR = 512;
dmx->Dma->CCR |= DMA_CCR_EN;
dmx->NewInput = 1;
if (dmx->BreakStatus) {
if (data == 0x00) {
dmx->Usart->CR3 |= USART_CR3_DMAR;
dmx->Dma->CMAR = dmx->DmxBuffer + 1;
dmx->Dma->CNDTR = 512;
dmx->Dma->CCR |= DMA_CCR_EN;
dmx->NewInput = 1;
}else{
dmx->BreakStatus = 0;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DMX G441/Src/eth/artnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void ArtNet_SendPollReply(const ip_addr_t *addr, u16_t port) {

reply->Port = UI16_BIG_ENDIAN(0x1936);

reply->VersInfo = UI16_LITTLE_ENDIAN(2);
reply->VersInfo = UI16_LITTLE_ENDIAN(ARTNET_FIRMWAREV);
reply->OEM = 0xFFFF;

reply->NetSwitch = config->ArtNetNetwork;
Expand Down

0 comments on commit 2a135d0

Please sign in to comment.