driver/serial: disable interrupt when writing to serial
This commit is contained in:
		@@ -39,6 +39,7 @@ bool pic_serial_Init(pic_serial_Port *port, int baudrate, int lineFlags) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void pic_serial_Write(pic_serial_Port *port, const char *str, int n) {
 | 
					void pic_serial_Write(pic_serial_Port *port, const char *str, int n) {
 | 
				
			||||||
	if (port && port->ok) {
 | 
						if (port && port->ok) {
 | 
				
			||||||
 | 
							INTERRUPT_DISABLE;
 | 
				
			||||||
		if (n != 0) {
 | 
							if (n != 0) {
 | 
				
			||||||
			for (int i = 0; i < n; i++) {
 | 
								for (int i = 0; i < n; i++) {
 | 
				
			||||||
				while ((inb(port->port + 5) & 0x20) == 0) {}
 | 
									while ((inb(port->port + 5) & 0x20) == 0) {}
 | 
				
			||||||
@@ -51,5 +52,6 @@ void pic_serial_Write(pic_serial_Port *port, const char *str, int n) {
 | 
				
			|||||||
				str++;
 | 
									str++;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							INTERRUPT_RESTORE;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user