gnupic: gpsim-la Logic Analyzer Module
Subject:
Re: gpsim-la Logic Analyzer Module
From:
Ralf Forsberg ####@####.####
Date:
20 Jul 2002 10:16:32 -0000
Message-Id: <20020720100259.GA18737@home.se>
On Fri, Jul 19, 2002 at 05:22:23PM +0200, Ralf Forsberg wrote:
> On Tue, Jul 16, 2002 at 07:33:50AM -0700, Scott Dattalo wrote:
> > On Tue, 16 Jul 2002, Nuno Miguel Fernandes Sucena Almeida wrote:
> >
> > > Hello,
> > > i hacked a simple Logic Analyzer Module for usage with Scott
> > > Dattalo gpsim PIC Simulator. Could you give it a try and comment
> > > please.You can get it at
> > >
> > > http://www.aeminium.org/gpsim-la/
>
> Yes! I'll try it out later.
It almost worked with latest gpsim too. There have been a few changes:
- The modules should have a destructor that free ports, breaks and the
interface.
LcdDisplay::~LcdDisplay()
{
gpsim_unregister_interface(interface_id);
delete data_port;
gpsim_clear_break(control_port);
delete control_port;
gtk_widget_destroy(window);
// free other data...
}
- There is a gpsim_register_gui_update, that registers a function to
be called when the gui should update (controlled from the gpsim main
window).
gpsim crashes when you close the window. This is not so nice:
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
There should perhaps instead be a handler for the "delete_event" signal,
but I'm not sure what to do with it. Other gui windows have a menu item
to re-open the windows, perhaps we can create a function in gpsim that
modules call to add a menu item to gpsim's windows menu?
, Or perhaps you can simply ignore the delete signal (do nothing and
return TRUE in the handler?).
And I see that a bug followed from gpsim to your module. The module
list must have a ending {NULL,NULL,NULL}.
/ Ralf