Files
OpenCellular/include/lightbar_msg_list.h
Eric Caruso fb5ff7b1bb lightbar: add seq type PROGRAM for user-programmable sequences
This diff allows the user to send small programs to the EC and
gain control of the lightbar. Right now, this is only exposed
through ectool, and sysfs support will come later.

To send a program to the EC, use
$ ectool lightbar program /path/to/program.bin
and then start running the program with
$ ectool lightbar seq program

BUG=None
BRANCH=ToT
TEST=Using the above steps with hand-assembled programs.
  Checked that infinite bytecode loops do not hang the EC.
  Checked that bad opcodes exit with an error.
  Stress tested pushing programs and changing sequences.

Signed-off-by: Eric Caruso <ejcaruso@chromium.org>
Change-Id: I635fb041a5dc5c403f7c26fb9a41b5563be9b6b7
Reviewed-on: https://chromium-review.googlesource.com/219558
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-25 07:59:16 +00:00

25 lines
788 B
C

/* Copyright (c) 2012 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 messages. It's done in this odd way so that
* we can automatically derive the correct constants, functions, and message
* types.
*/
#define LIGHTBAR_MSG_LIST \
LBMSG(ERROR), /* 0 */ \
LBMSG(S5), /* 1 */ \
LBMSG(S3), /* 2 */ \
LBMSG(S0), /* 3 */ \
LBMSG(S5S3), /* 4 */ \
LBMSG(S3S0), /* 5 */ \
LBMSG(S0S3), /* 6 */ \
LBMSG(S3S5), /* 7 */ \
LBMSG(STOP), /* 8 */ \
LBMSG(RUN), /* 9 */ \
LBMSG(PULSE), /* A */ \
LBMSG(TEST), /* B */ \
LBMSG(KONAMI), /* C */ \
LBMSG(TAP), /* D */ \
LBMSG(PROGRAM), /* E */