dcs-bios / dcs-bios

http://dcs-bios.a10c.de
Other
247 stars 65 forks source link

Sample Program doesn't work correctly after changing window. #94

Open crow0827 opened 8 years ago

crow0827 commented 8 years ago

I faced problem. please advise me. whole process

  1. execute "connect-serial-port.cmd".
  2. execute "DCS".
  3. change the window from DCS to other example for using ALT+TAB.
  4. change back into DCS.
  5. LED and Switchs don't work and RX Led which on Arduino Micro flash 1 Per second. in addition, cmd's log is updated at same time with RX Led.

Can I avoid the problem?

crow0827 commented 8 years ago

Sorry. Above sentences are including lie. I added simple Potentiometer code. When I control Potentiometer, the phenomenon of Section 5 occured. But I can't decide that Section 3's condition is included into cause...

jboecker commented 8 years ago

The Potentiometer class is known to misbehave because it doesn't implement any kind of averaging or hysteresis. It will spam the communication channel to the PC because any potentiometer will be a bit noisy. When using the DCSBIOS_DEFAULT_SERIAL compatibility mode, that will eventually cause the serial receive buffer to overflow because it will end up spending too much time transmitting new potentiometer values.

In the recommended IRQ_SERIAL mode incoming data is prioritized over transmitting messages and potentiometers should work.

The proper fix would be configurable averaging and hysteresis, but I don't have the time to do the testing and related changes to documentation and the example code generator.

I'll think about rate-limiting pots to one update per 100 ms. That can be implemented without changing existing APIs and should not require any tuning that depends on individual characteristics of the connected potentiometer.