mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
installer: SERIAL: Use Timer1 instead of Timer2
Same as in the main code. Use Timer1 as baudrate generator. Timer1 can be programmed to have the same accuracy and deviation as Timer2, up to 115200 at F_SYS = 125 Mhz. See comment setup_serial_timer1() comment for valid baudrates and settings. Timer1 is used in 8-bit auto-reload mode. Only differance is that the serial is transmit only and poll-based so no interrupts are used to transmit data.
This commit is contained in:
+3
-1
@@ -121,7 +121,7 @@ __xdata char sfp_module_vendor[2][17];
|
||||
__xdata char sfp_module_model[2][17];
|
||||
__xdata char sfp_module_serial[2][17];
|
||||
__xdata uint8_t sfp_options[2];
|
||||
__sbit tx_buf_empty = 1;
|
||||
__sbit tx_buf_empty;
|
||||
|
||||
#define ETHERTYPE_OFFSET (12 + VLAN_TAG_SIZE + RTL_TAG_SIZE)
|
||||
|
||||
@@ -1713,6 +1713,8 @@ void setup_serial_timer1(void)
|
||||
TI = 0; // Clear TI-interrupt flag
|
||||
RI = 0; // Clear RI-interrupt flag
|
||||
|
||||
tx_buf_empty = 1; // Set tx `serial buffer is empty`-software flag.
|
||||
|
||||
ES = 1; // Enable serial IRQ
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user