diff options
author | Tzung-Bi Shih <tzungbi@kernel.org> | 2023-03-21 14:14:14 +0800 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2023-03-21 14:14:14 +0800 |
commit | aa95c0c3dace8b86932917366955c031e8a91f10 (patch) | |
tree | 77b7d85c3c91f2de696c62149123f324fa01f2ac | |
parent | 5c019323f76733162e1aa8da9991b22a120366da (diff) | |
download | cros-ec-tests-aa95c0c3dace8b86932917366955c031e8a91f10.tar.gz |
helpers/mcu: use explicit ctypes
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
-rw-r--r-- | cros/helpers/mcu.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/cros/helpers/mcu.py b/cros/helpers/mcu.py index c9ac199..52354f9 100644 --- a/cros/helpers/mcu.py +++ b/cros/helpers/mcu.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from ctypes import addressof -from ctypes import c_ubyte, c_uint, c_uint64 +from ctypes import c_ubyte, c_uint8, c_uint32, c_uint64 from ctypes import memmove from ctypes import sizeof from ctypes import Structure @@ -71,28 +71,29 @@ EC_IMAGE_RW = 2 class cros_ec_command(Structure): _fields_ = [ - ("version", c_uint), - ("command", c_uint), - ("outsize", c_uint), - ("insize", c_uint), - ("result", c_uint), - ("data", c_ubyte * EC_HOST_PARAM_SIZE), + ("version", c_uint32), + ("command", c_uint32), + ("outsize", c_uint32), + ("insize", c_uint32), + ("result", c_uint32), + ("data", c_uint8 * EC_HOST_PARAM_SIZE), ] class ec_params_hello(Structure): - _fields_ = [("in_data", c_uint)] + _fields_ = [("in_data", c_uint32)] class ec_response_hello(Structure): - _fields_ = [("out_data", c_uint)] + _fields_ = [("out_data", c_uint32)] + class ec_response_get_version(Structure): _fields_ = [ ("version_string_ro", c_ubyte * 32), ("version_string_rw", c_ubyte * 32), ("reserved", c_ubyte * 32), - ("current_image", c_uint), + ("current_image", c_uint32), ] class ec_response_get_features(Structure): |