mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2025-10-29 11:33:20 +00:00
w
This commit is contained in:
parent
e3167f30a6
commit
812956fa2b
@ -44,7 +44,26 @@ static int dmx_pixelSize = 3;
|
||||
int dmx_pin = 22;
|
||||
|
||||
void DMX_Show() {
|
||||
// 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
|
||||
#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);
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
byte DMX_GetByte(uint32_t idx) {
|
||||
@ -79,26 +98,6 @@ void DMX_Init() {
|
||||
void HAL_UART_Flush(void);
|
||||
void HAL_SetBaud(uint32_t baud);
|
||||
void DMX_OnEverySecond() {
|
||||
// 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
|
||||
#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);
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user