diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-06-20 10:40:26 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-06-28 07:06:46 -0700 |
commit | dcfbe0be69d3445edfd45fb036bfae2581b6fdd5 (patch) | |
tree | de448bc3d41945e0bc0cf2f098e10ca14fc49419 /common/lightbar.c | |
parent | 6f38ed23f3d467937f15cf0474b8f323564bcc0d (diff) | |
download | chrome-ec-dcfbe0be69d3445edfd45fb036bfae2581b6fdd5.tar.gz |
ec: Make it possible to build tests using clang
We might want to try out address sanitizer/fuzzer on some host
tests: make it possible to build host tests using clang.
Board builds are broken, and there is no intention to fix them,
at least for now.
BRANCH=none
BUG=chromium:854924
TEST=make buildall -j
TEST=make CC=clang runtests -j
Change-Id: Id49a1b8537bc403d53437a2245f4fab6ceae89ac
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1107522
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common/lightbar.c')
-rw-r--r-- | common/lightbar.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/common/lightbar.c b/common/lightbar.c index 9a01e64ccd..c7fed67e7e 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -412,21 +412,6 @@ static inline int cycle_010(uint8_t i) ((_ramp_table[bucket + 1] - _ramp_table[bucket]) * index >> 2); } -/* This function provides a smooth oscillation between -0.5 and +0.5. - * Zero starts at 0x00. */ -static inline int cycle_0p0n0(uint8_t i) -{ - return cycle_010(i + 64) - FP_SCALE / 2; -} - -/* This function provides a pulsing oscillation between -0.5 and +0.5. */ -static inline int cycle_npn(uint16_t i) -{ - if ((i / 256) % 4) - return -FP_SCALE / 2; - return cycle_010(i) - FP_SCALE / 2; -} - /******************************************************************************/ /* Here's where we keep messages waiting to be delivered to the lightbar task. * If more than one is sent before the task responds, we only want to deliver @@ -524,6 +509,14 @@ static uint32_t sequence_S3S0(void) #ifdef BLUE_PULSING +/* This function provides a pulsing oscillation between -0.5 and +0.5. */ +static inline int cycle_npn(uint16_t i) +{ + if ((i / 256) % 4) + return -FP_SCALE / 2; + return cycle_010(i) - FP_SCALE / 2; +} + /* CPU is fully on */ static uint32_t sequence_S0(void) { |