initial gpio state: power on -> boot -> rtos -> app.

2023-02-18 Thread Tomek CEDRO
Hello world :-) I am working on a pretty industrial automation project right now that will control 3 phase motor over 400V/25A relays. There are 6 relays to provide all possible modes of 3 phase motor control. There are 3 groups of two relays for a task like direction change, star-left-star-right

Re: esp32 / pcnt / rotary encoder

2023-02-18 Thread Tomek CEDRO
Allright, I have NuttX origin/master built on FreeBSD and running on ESP32-DevKitC :-) For some reason uname -a shows release 10.4.0 not 12.0.0(99/dev whatever) o_O The whole NuttX firmware build and flashing is faster than scripts upload in MicroPython heheh.. and they fight for encoder / timer

Re: Maximum file descriptor number in select()?

2023-02-18 Thread Gregory Nutt
> >..l. I could not find where > > select() or poll() are implemented in the nuttx repository. Is there > some > > kind of magic going on with that? > > > > > They hare here: > https://github.com/apache/nuttx/blob/master/fs/vfs/fs_select.c > https://github.com/apache/nuttx/blob/master/fs/vfs/fs_p

Re: Maximum file descriptor number in select()?

2023-02-18 Thread Xiang Xiao
On Sun, Feb 19, 2023 at 10:21 AM Gregory Nutt wrote: > > fd_set is a 32bit array, the max fd number is hardcode to 256: > >https://github.com/apache/nuttx/blob/master/include/sys/select.h#L38-L91 > > > I just found that a

Re: Maximum file descriptor number in select()?

2023-02-18 Thread Gregory Nutt
> fd_set is a 32bit array, the max fd number is hardcode to 256: >https://github.com/apache/nuttx/blob/master/include/sys/select.h#L38-L91 I just found that and was sending an email. I could not find where select() or pol

Re: Maximum file descriptor number in select()?

2023-02-18 Thread Xiang Xiao
fd_set is a 32bit array, the max fd number is hardcode to 256: https://github.com/apache/nuttx/blob/master/include/sys/select.h#L38-L91 it's better to define FD_SETSIZE to OPEN_MAX. On Sun, Feb 19, 2023 at 9:53 AM Gregory Nutt wrote: > That is okay. My answer is possibly wrong anyway. OPEN_MA

Re: Maximum file descriptor number in select()?

2023-02-18 Thread Gregory Nutt
That is okay. My answer is possibly wrong anyway. OPEN_MAX is the maximum number of open files. For the select, the file descriptor set was held in a 32-bit bit set so the maximum was 31. But that logic has been redesigned and I don’t know how it works now. Hopefully, it supports up to OPEN_

Re: Maximum file descriptor number in select()?

2023-02-18 Thread KIKUCHI Takeyoshi
Hi Greg, Sorry, it seems that the same one was delivered late, probably because I sent it with the wrong email source account (not the one I subscribed to the list). best regards, KIKUCHI Takeyoshi On 2023/02/19 9:20, Gregory Nutt wrote: The maximum number of file descriptors is a constant

Re: Maximum file descriptor number in select()?

2023-02-18 Thread Gregory Nutt
The maximum number of file descriptors is a constant value provided by the preprocessor definition OPEN_MAX. On 2/16/2023 5:44 PM, KIKUCHI Takeyoshi wrote: currently porting the Nim language to NuttX. (It has been merged into the Nim devel branch) When using select/epoll, it is necessary to de

Maximum file descriptor number in select()?

2023-02-18 Thread KIKUCHI Takeyoshi
currently porting the Nim language to NuttX. (It has been merged into the Nim devel branch) When using select/epoll, it is necessary to determine the maximum value of file descriptor in order to assign a structure to store the fd to be waited in advance. It is used in this way. - pro

Re: esp32 / pcnt / rotary encoder

2023-02-18 Thread Tomek CEDRO
On Sat, Feb 18, 2023 at 9:53 PM Alan C. Assis wrote: > Hi Tomek, > Please take a look: > https://github.com/apache/nuttx/blob/master/arch/xtensa/src/esp32/esp32_qencoder.c > > It was tested with common rotary encoders (i.e. those used on 3D > Printers to select items on UI menu). > > I didn't test

Re: esp32 / pcnt / rotary encoder

2023-02-18 Thread Alan C. Assis
Hi Tomek, Please take a look: https://github.com/apache/nuttx/blob/master/arch/xtensa/src/esp32/esp32_qencoder.c It was tested with common rotary encoders (i.e. those used on 3D Printers to select items on UI menu). I didn't test it at high frequencies, but according with this thread https://es

esp32 / pcnt / rotary encoder

2023-02-18 Thread Tomek CEDRO
Hello world :-) Is PCNT peripheral supported on ESP32 port in NuttX? I am building a new device that will use industrial rotary encoder with pulses up to 1..3MHz so GPIO/IRQ processing is probably not a good idea. I am wondering if there are such rotary use cases in NuttX? I wanted to use RISC-

Re: Article: NuttX for PinePhone: Exploring USB

2023-02-18 Thread Alan C. Assis
Hi Lup, Very nice post! Adding this USB Controller on NuttX will allow to use many other chips that use same IP. There is also some modem modules with this Quectel chip at aliexpress, i.e.: https://aliexpress.com/item/1005004508534864.html BR, Alan On 2/18/23, Lee, Lup Yuen wrote: > We're ab