These are chat archives for SmingHub/Sming

27th
Mar 2016
alonewolfx2
@alonewolfx2
Mar 27 2016 14:33

Basic_NFC example & RFID_MFRC522 Library added into the smingRTOS repo

hreintke
@hreintke
Mar 27 2016 16:29

@/all :
I added two classes to SmingRTOS which are using the underlying FreeRTOS functionality.

  • QueuedDelegate , Used as QueuedDelegate<yourType>
    It creates a queue and a task. By using the sendQueue method you can divert processing to a separate task

  • QueuedInterrupt. Is a derived class from QueuedDelegate.
    It provides an interface in which a "pin interrupt" is forwarded using a queue/task to a delegate.
    The delegate is not processed within the ISR -> no limitations on timing/function usage
    The delegate is processed in a separate task

I added the samples Basic_Queue and Basic_QueuedInterrupt to show the functionality.

Patrick Jahns
@patrickjahns
Mar 27 2016 16:31
:thumbsup: - very nice things happening in SMING
alon24
@alon24
Mar 27 2016 17:14
So what would be a good thing to offload? Is there a locking
HappyCodingRobot
@HappyCodingRobot
Mar 27 2016 17:20
Sounds great .. :thumbsup:
alonewolfx2
@alonewolfx2
Mar 27 2016 18:18

Nextion HMI Display library and example added into the smingRTOS

hreintke
@hreintke
Mar 27 2016 18:36
@alon24 :
It is up to the application what can/needs to be offloaded.
It is offloading and the QueuedDelegate is not executed in the calling function.
There is no locking implemented. Each QueuedDelegate instance has its own queue and task.
This task takes the queued delegates in a serial way.
alon24
@alon24
Mar 27 2016 19:02
I think I will try it for the screen update task
hreintke
@hreintke
Mar 27 2016 19:10
Probably a good choice and nice to see the first use besides myself.
Let me know if there are questions/issues/problems.
alon24
@alon24
Mar 27 2016 19:20
I will,
hreintke
@hreintke
Mar 27 2016 19:54

@alon24 :
I think I saw you use anonymous/lambda functions in your sousvide.
Made me do some experiments. Can do things like :

    t1.initializeMs(1000,
                    [](){
                            debugf("This a timer message");}
                    ).start();
public :
    LedBlinker(int reqPin) : ledPin(reqPin) {
        pinMode(ledPin, OUTPUT);
        ledTimer.initializeMs(1000,
                                [](){debugf("class function test");}
                              ).start();
    };

Nice..

alon24
@alon24
Mar 27 2016 20:06
I did not know this code predigma before, so was not me
Could the new queue delegate be used for websockets
And thus take the load of main thread?
Off of main thread
What I am thinking of using it is for I foscreens, I yardage screen every x Mills, so do that I it's own thread
I update screen