ppisa commented on issue #18566:
URL: https://github.com/apache/nuttx/issues/18566#issuecomment-5266692452

   I have tested MW example with the current latest Microwindows and NuttX APPs 
and there are some things to solve. I am for discussed change
   ```diff
   index 0835d5e..edc0b94 100644
   --- a/src/mwin/winmain.c
   +++ b/src/mwin/winmain.c
   @@ -278,7 +279,11 @@ MwSelect(BOOL canBlock)
         */
        timeout = tout.tv_sec = tout.tv_usec = 0L;
        to = &tout;
   -    int poll = (!canBlock || dragwp);               /* just poll if can't 
block or window move in progress*/
   +#if NUTTX
   +    int poll = !canBlock;
   +#else
   +    int poll = (!canBlock || dragwp);
   +#endif
        if (!poll)
        {
                timeout = MwGetNextTimeoutValue();      /* get next mwin timer 
or (MWTIMEOUT) -1L if none */
   
   ```
   In the fact, I would vote even to break busy loop for as many targets as 
possible. Probably all which have correct 
   timing and real `poll()` support. But I would start with NuttX for now and 
when it is tested in Linux and may be RTEMS and others one day then extend the 
condition.
   
   The `#if NUTTX` did not work for me with the latest NuttX APPs 
`add-microwindows`. I would propose
   ```diff
   index 0835d5e..edc0b94 100644
   --- a/src/mwin/winmain.c
   +++ b/src/mwin/winmain.c
   @@ -25,6 +25,7 @@
    #include "windlg.h"
    #include "device.h"
    #include "osdep.h"
   +#include "mwconfig.h"
    
    /*
     * External definitions defined here.
   ```
   but even that is not enough because `NUTTX` is not set to `1` in 
`microwindows/src/include/mwconfig.nuttx` and even in NuttX APPs Microwindows 
`Makefile` for now.  The change in NuttX APPs solve my problem
   ```diff
   diff --git a/graphics/microwindows/Makefile b/graphics/microwindows/Makefile
   index 6b0ae03f0..d274bf116 100644
   --- a/graphics/microwindows/Makefile
   +++ b/graphics/microwindows/Makefile
   @@ -85,6 +85,8 @@ endif
    
    MW_DIR_OBJ = $(WD)/$(MICROWINDOWS_DIR_NAME)/src
    
   +CFLAGS += -DNUTTX=1
   +
    # Select NuttX drivers via Microwindows Objects.rules
    ARCH = NUTTX
    
   ```
   May it be, next could help
   ```diff
   diff --git a/src/include/mwconfig.nuttx b/src/include/mwconfig.nuttx
   index 15aff64..2ab921f 100644
   --- a/src/include/mwconfig.nuttx
   +++ b/src/include/mwconfig.nuttx
   @@ -2,6 +2,8 @@
     * Included by mwconfig.h via -DMWCONFIG_FILE='"mwconfig.nuttx"'
     */
   
   +#undef  NUTTX
   +#define NUTTX               1
    #ifndef NANOWM
    #define NANOWM              0
    #endif
   ```
   But in general, if you need something to be changed according to config in 
the `src/include/mwconfig.nuttx` file then there could be two different files 
or one generated but limit dependency on defines provided provided to compiler 
on command line as is with `NANOWM` in 
https://github.com/ghaerr/microwindows/pull/196 . But that is for discussion. 
   
   I have tried Nano-X but something has changed because `nanoxterm` depends on 
`ARCH_HAVE_FORK` (at least now) which is not provided by NuttX `qemu-intel64` 
board.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to