mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2025-10-29 11:33:20 +00:00
test 2x
This commit is contained in:
parent
1d003279f1
commit
ff9d0d4fd4
@ -49,30 +49,32 @@ void DMX_Show() {
|
||||
if (g_dmxBuffer == 0) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < 2; i++) {
|
||||
#if WINDOWS
|
||||
// BREAK: pull TX low manually
|
||||
HAL_PIN_Setup_Output(dmx_pin);
|
||||
HAL_PIN_SetOutputValue(dmx_pin, 0);
|
||||
HAL_Delay_us(120); // ≥88µs
|
||||
HAL_PIN_SetOutputValue(dmx_pin, 1);
|
||||
HAL_Delay_us(12); // MAB ≥8µs
|
||||
// BREAK: pull TX low manually
|
||||
HAL_PIN_Setup_Output(dmx_pin);
|
||||
HAL_PIN_SetOutputValue(dmx_pin, 0);
|
||||
HAL_Delay_us(120); // ≥88µs
|
||||
HAL_PIN_SetOutputValue(dmx_pin, 1);
|
||||
HAL_Delay_us(12); // MAB ≥8µs
|
||||
#else
|
||||
#define DMX_BREAK_DURATION_MICROS 88
|
||||
uint32_t breakBaud = 1000000 * 8 / DMX_BREAK_DURATION_MICROS;
|
||||
HAL_SetBaud(breakBaud);
|
||||
HAL_UART_SendByte(0);
|
||||
HAL_UART_Flush();
|
||||
HAL_SetBaud(250000);
|
||||
uint32_t breakBaud = 1000000 * 8 / DMX_BREAK_DURATION_MICROS;
|
||||
HAL_SetBaud(breakBaud);
|
||||
HAL_UART_SendByte(0);
|
||||
HAL_UART_Flush();
|
||||
HAL_SetBaud(250000);
|
||||
#endif
|
||||
|
||||
//HAL_UART_Init(250000, 2, false);
|
||||
// restore UART and send DMX data
|
||||
for (int i = 0; i < DMX_BUFFER_SIZE; i++) {
|
||||
HAL_UART_SendByte(g_dmxBuffer[i]);
|
||||
//HAL_UART_Init(250000, 2, false);
|
||||
// restore UART and send DMX data
|
||||
for (int i = 0; i < DMX_BUFFER_SIZE; i++) {
|
||||
HAL_UART_SendByte(g_dmxBuffer[i]);
|
||||
}
|
||||
//Serial485.begin(250000, SERIAL_8N2, RS485_RX_PIN, RS485_TX_PIN);
|
||||
////Serial485.write(dmxBuffer, sizeof(dmxBuffer));
|
||||
//Serial485.flush();
|
||||
}
|
||||
//Serial485.begin(250000, SERIAL_8N2, RS485_RX_PIN, RS485_TX_PIN);
|
||||
////Serial485.write(dmxBuffer, sizeof(dmxBuffer));
|
||||
//Serial485.flush();
|
||||
}
|
||||
|
||||
byte DMX_GetByte(uint32_t idx) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user