Rockbox Development > Feature Ideas
day / night mode by hour
[Saint]:
--- Quote from: whiskers75 on January 12, 2013, 02:48:27 AM ---I don't know C, and shouldn't be doing this. Therefore, I won't.
--- End quote ---
That seems rather defeatist. One would think the answer would be to learn C.
I hope you haven't come to the conclusion that anyone is trying to drive you away from the project or discourage you from contributing.
To put it as simply as I can, one can either give a man a fish, or teach a man to fish. If you are going to teach a man to fish, one should first make sure that they are using a fishing rod, instead of a shovel.
[Saint]
whiskers75:
--- Quote from: [Saint] on January 12, 2013, 04:14:42 AM ---
--- Quote from: whiskers75 on January 12, 2013, 02:48:27 AM ---I don't know C, and shouldn't be doing this. Therefore, I won't.
--- End quote ---
That seems rather defeatist. One would think the answer would be to learn C.
I hope you haven't come to the conclusion that anyone is trying to drive you away from the project or discourage you from contributing.
To put it as simply as I can, one can either give a man a fish, or teach a man to fish. If you are going to teach a man to fish, one should first make sure that they are using a fishing rod, instead of a shovel.
[Saint]
--- End quote ---
What I'm saying is, I shouldn't be doing C while I'm in the middle of JS stuff.
whiskers75:
This is being worked on.After reading up on C, I know more about how to do it.
(FYI, the CI system is now working using rockboxdev.sh)
Create a function:
--- Code: ---void update_dn() {
}
--- End code ---
Save it in daynight.h
Require it in main.c:
--- Code: ---#include "daynight.h"
--- End code ---
Call the function (every second/minute/hour):
--- Code: ---update_dn()
--- End code ---
Profit!
bluebrother:
--- Quote from: whiskers75 on February 01, 2013, 01:53:01 PM ---Save it in daynight.h
--- End quote ---
You shouldn't put functions in header files. There are a few cases where this is necessary but this isn't one of them.
--- Quote ---Profit!
--- End quote ---
That function is empty, i.e. does nothing. How is that going to profit?
whiskers75:
I left out the bits inside the function.
OK, fine, I'll put it in daynight.c.
Update: Here: Day/night prototype 1, commit 26a4a3b55e. Include daynight.c and run daynight() when you want to update day/night status. Build Status
Navigation
[0] Message Index
[*] Previous page
Go to full version