mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
Add compiler/decompiler for lightbar bytecode programs.
BUG=none
BRANCH=ToT
TEST=manual
make BOARD=samus
for i in extra/lightbar/programs/[g-z]*.bin; do
./build/samus/util/lbcc -d $i /tmp/x.lbs
./build/samus/util/lbcc /tmp/x.lbs /tmp/x.bin
cmp $i /tmp/x.bin
done
Change-Id: I86c014c425e917ecafadd1c6845fcf2e5b4edbb7
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/220244
This commit is contained in:
committed by
chrome-internal-fetch
parent
af3d103dbc
commit
87762fa699
@@ -1037,6 +1037,7 @@ struct lightbar_params_v1 {
|
||||
|
||||
/* Lightbyte program. */
|
||||
#define LB_PROG_LEN 192
|
||||
#define LB_PROG_MAX_OPERANDS 4
|
||||
struct lb_program {
|
||||
uint8_t size;
|
||||
uint8_t data[LB_PROG_LEN];
|
||||
|
||||
@@ -19,6 +19,21 @@ enum lightbar_sequence {
|
||||
};
|
||||
#undef LBMSG
|
||||
|
||||
/* Bytecode field constants */
|
||||
enum lb_color {
|
||||
LB_COL_RED,
|
||||
LB_COL_GREEN,
|
||||
LB_COL_BLUE,
|
||||
LB_COL_ALL
|
||||
};
|
||||
|
||||
enum lb_control {
|
||||
LB_CONT_COLOR0,
|
||||
LB_CONT_COLOR1,
|
||||
LB_CONT_PHASE,
|
||||
LB_CONT_MAX
|
||||
};
|
||||
|
||||
/* Request a preset sequence from the lightbar task. */
|
||||
void lightbar_sequence(enum lightbar_sequence s);
|
||||
|
||||
|
||||
15
include/lightbar_opcode_list.h
Normal file
15
include/lightbar_opcode_list.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*
|
||||
* This defines a list of lightbar opcodes for programmable sequences.
|
||||
*/
|
||||
#define LIGHTBAR_OPCODE_TABLE \
|
||||
OP(JUMP), \
|
||||
OP(DELAY), \
|
||||
OP(SET_BRIGHTNESS), \
|
||||
OP(SET_COLOR), \
|
||||
OP(SET_DELAY_TIME), \
|
||||
OP(RAMP_ONCE), \
|
||||
OP(CYCLE_ONCE), \
|
||||
OP(CYCLE),
|
||||
Reference in New Issue
Block a user