Commit 2430c7f9 authored by lcgamboa's avatar lcgamboa

chg: LCD hd44780 input pin bug fixed !minor

parent 9be06f6e
......@@ -290,9 +290,12 @@ board_ucsim::MStep(void)
if (*pins[i].port < 4)
{
pins[i].value = (p[*pins[i].port] & (0x0001 << pins[i].pord)) > 0;
if (procid != PID_C51)
{
pins[i].dir = (p[*pins[i].port] & (0x0100 << pins[i].pord)) > 0;
}
}
}
}
......
......@@ -408,11 +408,11 @@ cpart_LCD_hd44780::Process(void)
//lcd dipins[2].display code
if ((input_pins[1] > 0) &&(!ppins[input_pins[1] - 1].dir)&&(!ppins[input_pins[1] - 1].value))
if ((input_pins[1] > 0) &&(!ppins[input_pins[1] - 1].value))
{
if (!lcde)
{
if ((input_pins[10] > 0)&&(!ppins[input_pins[10] - 1].dir))
if (input_pins[10] > 0)
{
if (!ppins[input_pins[10] - 1].value)
{
......@@ -427,11 +427,11 @@ cpart_LCD_hd44780::Process(void)
if ((input_pins[3] > 0)&&(ppins[input_pins[3] - 1].value)) d |= 0x02;
if ((input_pins[2] > 0)&&(ppins[input_pins[2] - 1].value)) d |= 0x01;
if ((!ppins[input_pins[0] - 1].dir)&&(!ppins[input_pins[0] - 1].value))
if (!ppins[input_pins[0] - 1].value)
{
lcd_cmd (&lcd, d);
}
else if ((!ppins[input_pins[0] - 1].dir)&&(ppins[input_pins[0] - 1].value))
else
{
lcd_data (&lcd, d);
}
......@@ -439,11 +439,11 @@ cpart_LCD_hd44780::Process(void)
else //Read
{
unsigned char val = 0;
if ((!ppins[input_pins[0] - 1].dir)&&(!ppins[input_pins[0] - 1].value))
if (!ppins[input_pins[0] - 1].value)
{
val = lcd_read_busyf_acounter (&lcd);
}
else if ((!ppins[input_pins[0] - 1].dir)&&(ppins[input_pins[0] - 1].value))
else
{
val = lcd_read_data (&lcd);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment