-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sample show more examples of std::function and std::bind #1378
Make sample show more examples of std::function and std::bind #1378
Conversation
myLed1.blink(true); | ||
myLed2.setTimer(500); | ||
myLed2.blink(true); | ||
WifiStation.enable(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the Wifi* call on this line and the one below. They are not directly related to the example and to what you are trying to demonstrate.
@frankdownunder Before I merge this PR I would like to know if you tested it on a real device? |
{ | ||
|
||
public: | ||
Task() {}; | ||
bool setTimer(int reqInterval) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding-Style: Put the opening curly brace on the next line.
} | ||
|
||
// This example show the way delegates have been used in Sming in the past. | ||
void callOldDelegate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding-Style: Put the opening curly brace on the next line.
bool ledState = true; | ||
}; | ||
// This example shows how to use a plain old ordinary function as a callback | ||
void callPlainOldOrdinaryFunction() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding-Style: Put the opening curly brace on the next line.
|
||
|
||
// This example shows how to use std::bind to make us of a function that has more parameters than our signature has | ||
void showHowToUseBind() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding-Style: Put the opening curly brace on the next line.
|
||
// Sming now allows the use of std::function | ||
// This example shows how to use a lamda expression as a callback | ||
void callLamda() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding-Style: Put the opening curly brace on the next line.
LedBlinker myLed2 = LedBlinker(LEDPIN_2); | ||
|
||
// This example shows how to use a member function as a callback | ||
void callMemberFunction() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coding-Style: Put the opening curly brace on the next line.
@slaff I built this sample using Ubuntu from the Windows Store (the replacement for WSL on Windows 10). To build it, I had to add these lines into makefile-user.mk (which I did not commit) size of the flash chipSPI_SIZE ?= 4M I tested it on a Wemos D1 mini by running it for a couple of minutes. |
@slaff Its hard to know what coding style sming uses.
Similarly if you turn on visible spaces, approx third of all lines in source code use spaces instead of tabs. |
That is something that, hopefully, will be explained and enforced soon. For now please make the requested changes above. |
I did
Sent from Mail for Windows 10
From: slaff
Sent: Tuesday, 15 May 2018 5:20 PM
To: SmingHub/Sming
Cc: frankdownunder; Mention
Subject: Re: [SmingHub/Sming] Make sample show more examples of std::functionand std::bind (#1378)
Its hard to know what coding style sming uses.
That is something that, hopefully, will be explained and enforced soon. For now please make the requested changes above.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
…---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
|
@frankdownunder Can you push your changes to github? I don't see them and there is no new commit showing up. |
I am new to git, I find it very confusing ☹
Sent from Mail for Windows 10
From: slaff
Sent: Tuesday, 15 May 2018 5:22 PM
To: SmingHub/Sming
Cc: frankdownunder; Mention
Subject: Re: [SmingHub/Sming] Make sample show more examples of std::functionand std::bind (#1378)
I did
@frankdownunder Can you push your changes to github? I don't see them and there is no new commit showing up.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
…---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
|
It is not that difficult ;-) . Go to your branch: feature/DelegatorsAndStdFunction_1337x2
Then make sure that you have commited your changes and finally do
So that those changes show up also in the PR. |
Try now
Sent from Mail for Windows 10
From: slaff
Sent: Tuesday, 15 May 2018 5:28 PM
To: SmingHub/Sming
Cc: frankdownunder; Mention
Subject: Re: [SmingHub/Sming] Make sample show more examples of std::functionand std::bind (#1378)
I am new to git, I find it very confusing ☹
It is not that difficult ;-) . Go to your branch: feature/DelegatorsAndStdFunction_1337x2
git checkout feature/DelegatorsAndStdFunction_1337x2
Then make sure that you have commited your changes and finally do
git push
So that those changes show up also in the PR.
Thanks in advance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
…---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
|
No description provided.