mirror of
https://github.com/pine64/blisp.git
synced 2026-09-18 14:41:36 +00:00
Adding RTS & DTS mechanism (not working yet)
This commit is contained in:
+10
@@ -3,6 +3,7 @@
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <blisp_util.h>
|
||||
|
||||
#define DEBUG
|
||||
|
||||
@@ -138,6 +139,15 @@ blisp_device_handshake(struct blisp_device* device, bool in_ef_loader) {
|
||||
uint8_t handshake_buffer[600];
|
||||
struct sp_port* serial_port = device->serial_port;
|
||||
|
||||
if (!in_ef_loader && !device->is_usb) {
|
||||
sp_set_rts(serial_port, SP_RTS_ON);
|
||||
sp_set_dtr(serial_port, SP_DTR_ON);
|
||||
sleep_ms(50);
|
||||
sp_set_rts(serial_port, SP_RTS_OFF);
|
||||
sleep_ms(100);
|
||||
sp_set_dtr(serial_port, SP_DTR_OFF);
|
||||
}
|
||||
|
||||
uint32_t bytes_count = device->chip->handshake_byte_multiplier * (float)device->current_baud_rate / 10.0f;
|
||||
if (bytes_count > 600) bytes_count = 600;
|
||||
memset(handshake_buffer, 'U', bytes_count);
|
||||
|
||||
Reference in New Issue
Block a user