After compiling and updating to latest stable 3.4.1 version I retested
the HW interrupt code I had problems with when running 3.3.4 and have the
same error when testing on the RaspberryPi...

Code compiles OK but when I pull GPIO18 pin low (i.e generating the
interrupt)
it crashes with a "Stack overflow" error message.

  root@raspi-dev:/home/Projekt/libwiringPi_irq# ./libwiringPi_irq.gambas
  wiringPi Init OK...
  IRQ setup OK...
  Waiting....
  Waiting....
  Waiting....
  Waiting....
  Waiting....
  Waiting....
  Waiting....
  Waiting....
  Waiting....
  MMain.Main.110: #3: Stack overflow
  1: MMain.Main.110
  Segmentation fault

Below is the output from gdb...

  ...
  (gdb) bt
  #0  THROW (code=0) at gb_error.c:465
  #1  0x0004a9e4 in THROW_STACK () at gb_error.c:489
  #2  0x0004a9e4 in THROW_STACK () at gb_error.c:489
  Backtrace stopped: previous frame identical to this frame (corrupt stack?)
  (gdb)

A informed by Benoît this is how to declare it in Gambas3 to use the
interrupt
function in wiringPi library...

>Extern wiringPiIsr(iPin As Integer, iEdgeType As Integer, pFunction As
Pointer) In "lib..."
>
>...
>
>And then you use the name of a static function as 'pFunction' argument
>when calling wiringPiIsr.
>
>Gambas will automatically create a internal callback that will execute
>the Gambas function through the interpreter as if it would be called
>directly like a C function.

As mentioned before problem may very well be in my code when setting up the
interrupt handler, attached is the source code and wonder if I'm doing it
correctly by placing the interrupt handler in a separate classfile so any
pointer
appreciated...

/CJ

Attachment: libwiringPi_irq.tar.gz
Description: GNU Zip compressed data

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to