Skip to content

timex: unambiguous time conversion macros#6399

Merged
OlegHahm merged 3 commits intoRIOT-OS:masterfrom
OlegHahm:timex_constants
Jan 19, 2017
Merged

timex: unambiguous time conversion macros#6399
OlegHahm merged 3 commits intoRIOT-OS:masterfrom
OlegHahm:timex_constants

Conversation

@OlegHahm
Copy link
Copy Markdown
Member

Fixes #4211.

I used:

git grep -l SEC_IN_USEC | xargs sed -i 's/MIN_IN_SEC/SEC_PER_MIN/'
git grep -l SEC_IN_USEC | xargs sed -i 's/SEC_IN_CS/CS_PER_SEC/'
git grep -l SEC_IN_USEC | xargs sed -i 's/SEC_IN_MS/MS_PER_SEC/'
git grep -l SEC_IN_USEC | xargs sed -i 's/SEC_IN_MS/MS_PER_SEC/'
git grep -l SEC_IN_USEC | xargs sed -i 's/MS_IN_USEC/USEC_PER_MS/'
git grep -l SEC_IN_USEC | xargs sed -i 's/USEC_IN_NS/NS_PER_USEC/'

@OlegHahm OlegHahm added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: timers Area: timer subsystems labels Jan 17, 2017
@OlegHahm OlegHahm added this to the Release 2017.01 milestone Jan 17, 2017
@kYc0o
Copy link
Copy Markdown
Contributor

kYc0o commented Jan 17, 2017

You forgot to replace SEC_IN_USEC ?

@kYc0o
Copy link
Copy Markdown
Contributor

kYc0o commented Jan 17, 2017

Well actually there are several errors... Can you try to fix them so I can rebase #6394 on top of this one? Or you prefer to first merge #6394 and then you add it to this PR?

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jan 17, 2017

@kYc0o, I don't think both PR will conflict. If you use the right convention in #6394 it will be fine.

The best is to wait for the first one being merged, the other PR will have to update accordingly.

@OlegHahm
Copy link
Copy Markdown
Member Author

I was a bit sloppy - as you can see from the commands pasted above. Should be fixed now by using the proper arguments for grep and adding a 'g' flag for sed.

@OlegHahm OlegHahm added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Jan 18, 2017
@OlegHahm
Copy link
Copy Markdown
Member Author

ccn-lite needs an update

@OlegHahm OlegHahm added the State: waiting for other PR State: The PR requires another PR to be merged first label Jan 18, 2017
@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 18, 2017

I used:

git grep -l SEC_IN_USEC | xargs sed -i 's/MIN_IN_SEC/SEC_PER_MIN/'
git grep -l SEC_IN_USEC | xargs sed -i 's/SEC_IN_CS/CS_PER_SEC/'
git grep -l SEC_IN_USEC | xargs sed -i 's/SEC_IN_MS/MS_PER_SEC/'
git grep -l SEC_IN_USEC | xargs sed -i 's/SEC_IN_MS/MS_PER_SEC/'
git grep -l SEC_IN_USEC | xargs sed -i 's/MS_IN_USEC/USEC_PER_MS/'
git grep -l SEC_IN_USEC | xargs sed -i 's/USEC_IN_NS/NS_PER_USEC/'

Wouldn't

git grep -l MIN_IN_SEC | xargs sed -i 's/MIN_IN_SEC/SEC_PER_MIN/'
git grep -l SEC_IN_CS | xargs sed -i 's/SEC_IN_CS/CS_PER_SEC/'
git grep -l SEC_IN_MS | xargs sed -i 's/SEC_IN_MS/MS_PER_SEC/'
git grep -l MS_IN_USEC | xargs sed -i 's/MS_IN_USEC/USEC_PER_MS/'
git grep -l USEC_IN_NS | xargs sed -i 's/USEC_IN_NS/NS_PER_USEC/'

make much more sense?

@OlegHahm
Copy link
Copy Markdown
Member Author

see #6399 (comment)

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 18, 2017

Sorry :-/

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 18, 2017

But as the discussion does not provide a consensus in #4211: what about CS -> CSEC, MS -> MSEC, NS -> NSEC?

@OlegHahm
Copy link
Copy Markdown
Member Author

I have no strong opinion, can do, if you prefer.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 18, 2017

I prefer it, but you 1 and @BytesGalore 2 (quoting SI units) disagreed in #4211, with no reply to my argument why I still prefer it 3 (e.g. US_PER_S looks weird).

@OlegHahm
Copy link
Copy Markdown
Member Author

Actually, I interpreted #4211 as a consensus.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 18, 2017

On the _PER_ part, yes. But the discussion thread seems a little bit more ambiguous about the S/SEC discussion to me (later posts liking the _PER_ only mention USEC_PER_SEC, the units of which are already SEC).

@OlegHahm
Copy link
Copy Markdown
Member Author

Which I read as an agreement on this solution. The only one who voted for SI units was @BytesGalore who kept silent during the later discussion with can be interpreted as agreement.

How about we make a quick poll tonight?

@OlegHahm
Copy link
Copy Markdown
Member Author

For the record, I would prefer SEC for seconds and MS, NS, US and CS for the rest - even if it is not 100% consistent.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 18, 2017

How about we make a quick poll tonight?

👍

@kYc0o
Copy link
Copy Markdown
Contributor

kYc0o commented Jan 18, 2017

For the record, I would prefer SEC for seconds and MS, NS, US and CS for the rest - even if it is not 100% consistent.

👍

@OlegHahm OlegHahm removed the State: waiting for other PR State: The PR requires another PR to be merged first label Jan 18, 2017
@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 18, 2017

For the record, I would prefer SEC for seconds and MS, NS, US and CS for the rest - even if it is not 100% consistent.

We talked about it offline, and I agree now.

@OlegHahm
Copy link
Copy Markdown
Member Author

Updated accordingly.

@OlegHahm
Copy link
Copy Markdown
Member Author

Updated CCN-lite and removed patches. Ready to squash?

@cgundogan
Copy link
Copy Markdown
Member

Jenkins says in https://riot-ci.inet.haw-hamburg.de/job/RIOT/job/PR-6399/9/artifact/error_airfy-beacon_linux_other_tests.log:

Building tests/xtimer_usleep for airfy-beacon
make: Entering directory '/opt/jenkins/workspace/RIOT_PR-6399-SI7A7I2QFQLIKR4ZMJNGNMT2GKJLP3TAHIUJWDXUDWBJZWO2Z3RA@2/tests/xtimer_usleep'
Building application "xtimer_usleep" for "airfy-beacon" with MCU "nrf51".

main.c: In function 'main':
main.c:37:28: error: 'SEC_IN_USEC' undeclared (first use in this function)
         xtimer_usleep(ONE_SEC_SLEEP);
                            ^
main.c:37:28: note: each undeclared identifier is reported only once for each function it appears in

@OlegHahm
Copy link
Copy Markdown
Member Author

Fixed the new test. Should I squash?

@cgundogan
Copy link
Copy Markdown
Member

👍 squash please

@OlegHahm
Copy link
Copy Markdown
Member Author

squashed

@smlng
Copy link
Copy Markdown
Member

smlng commented Jan 19, 2017

needs rebase, now

@OlegHahm
Copy link
Copy Markdown
Member Author

rebased

@smlng
Copy link
Copy Markdown
Member

smlng commented Jan 19, 2017

requires merge of ccn-lite PR 104 and update ccn-lite pkg_version here, afterwards

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jan 19, 2017

cn-uofbasel/ccn-lite#104 was merged

PKG_NAME=ccn-lite
PKG_URL=https://github.com/cn-uofbasel/ccn-lite/
PKG_VERSION=0b1de2da1ef407ee5793c0e7eda420391ae056dc
PKG_VERSION=3bddb34dbb27d814acaca922655d760481b2998a
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update to cn-uofbasel/ccn-lite@10119ca

@OlegHahm
Copy link
Copy Markdown
Member Author

I don't understand what cn-uofbasel/ccn-lite#104 has to do with this PR?

@smlng
Copy link
Copy Markdown
Member

smlng commented Jan 19, 2017

@OlegHahm nothing directly, but if you update the package version (which you have to do) and make you PR get through CI, you need the fixed ccn-lite version, that is with pr 104 merged.

@smlng
Copy link
Copy Markdown
Member

smlng commented Jan 19, 2017

see error log from jenkins here

@OlegHahm
Copy link
Copy Markdown
Member Author

Ah, I wasn't aware that cn-uofbasel/ccn-lite@d720a6c was already merged.

@smlng
Copy link
Copy Markdown
Member

smlng commented Jan 19, 2017

@OlegHahm: please update pkg version, so we get this and macOS support (#6341) into the release?

@OlegHahm
Copy link
Copy Markdown
Member Author

Updated

@OlegHahm OlegHahm merged commit 6936366 into RIOT-OS:master Jan 19, 2017
@OlegHahm OlegHahm deleted the timex_constants branch January 19, 2017 16:29
@kYc0o kYc0o mentioned this pull request Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: timers Area: timer subsystems CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants