Interesting. I found in the Perl script, if I print a string to the LCD prior to calling lcd_char_def() it works. So I took a step back and in the actual function itself, I added a call to lcdPuts(), and printing a newline (which is essentially a zero-width char on the display). This fixes it.
sub lcd_char_def { shift if @_ == 4; my ($fd, $index, $data) = @_; lcdPuts($fd, "\n"); my $unsigned_char = pack "C[8]", @$data; lcdCharDef($fd, $index, $unsigned_char); }
So I have a code problem somewhere it seems, but at least this is a cheesy workaround until I can track it down.
In reply to Re: External C function called through XS not Doing The Right Thing
by stevieb
in thread [SOLVED (workaround)]: External C function called through XS not Doing The Right Thing
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |