Re: Using ASM with Java in TINIOS
Thomas Chenot <tom.chenot-6tN4nzCoH/[email protected]> Thu, 10 Jun 2004 10:24:56 -0500
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Message-ID | <[email protected]> |
Theeraputh Mekathikom wrote: > >I also wonder that is it possible to call back java >from native code, > No. Callbacks are not implemented. >like to notify that the code is >finished doing something because I may need to >override the serial interrupt (and when ISR finish >doing something, then call back the application). > > Typically you would write a native method that is called from a separate thread from the primary application. The native method suspends itself and is woken up when a desired event happens (See sleep, suspend, resume methods in Native_API.txt - The NativeLibrary example uses sleep). The trick is that you cannot wake the thread from an ISR without risking deadlock. IO_Poll is typically used to resume native threads. The ISR signals your IO_Poll routine (IO_Poll routines, installing/removing are described in Native_API.txt) and your IO_Poll routine wakes up your thread. Your thread can then fill in an array or return a standard data type (this is done in the nativelibrary sleep example) to return back to Java. The netcam reference (ftp://ftp.dalsemi.com/pub/tini/reference_designs/netcam/) is a more complex example. See camera.a51 for the native code and camera.java for the related Java code. >With Best Regards, >Theeraputh Mekathikom > > > > -- Thomas Chenot _______________________________________________ TINI mailing list TINI-6tN4nzCoH/[email protected] To UNSUBSCRIBE, edit your profile, or see list archives: http://lists.dalsemi.com/mailman/listinfo/tini