mirror of
https://github.com/google/pebble.git
synced 2025-07-13 01:41:52 -04:00
Merge ecfd50f991
into 4051c5bb97
This commit is contained in:
commit
74b93756f3
516 changed files with 1078 additions and 1078 deletions
|
@ -305,7 +305,7 @@ def compute_magnitude(x):
|
|||
|
||||
|
||||
###################################################################################################
|
||||
def apply_gausian(x, width=0.1):
|
||||
def apply_gaussian(x, width=0.1):
|
||||
""" Multiply x by the gaussian function. Width is a fraction, like 0.1
|
||||
"""
|
||||
result = []
|
||||
|
@ -377,8 +377,8 @@ if __name__ == '__main__':
|
|||
print "\n############ INPUT ######################"
|
||||
print_graph(input)
|
||||
|
||||
print "\n############ GAUSIAN OF INPUT ############"
|
||||
# input = apply_gausian(input, 0.1)
|
||||
print "\n############ GAUSSIAN OF INPUT ############"
|
||||
# input = apply_gaussian(input, 0.1)
|
||||
print_graph(input)
|
||||
|
||||
result = real_value_fft(input)
|
||||
|
@ -425,7 +425,7 @@ if __name__ == '__main__':
|
|||
input = [x - mean_mag for x in input]
|
||||
|
||||
print "\n############ INPUT ######################"
|
||||
# input = apply_gausian(input)
|
||||
# input = apply_gaussian(input)
|
||||
print_graph(input)
|
||||
|
||||
result = real_value_fft(input)
|
||||
|
|
|
@ -164,7 +164,7 @@ class JIRASupport(object):
|
|||
watch_logs = []
|
||||
got_device_logs = False
|
||||
for path in sorted(local_attachment_paths):
|
||||
# iOS uses "watch_logs...", Android <2.1 uses "pebble.log", and Androind >=2.1 (Holo)
|
||||
# iOS uses "watch_logs...", Android <2.1 uses "pebble.log", and Android >=2.1 (Holo)
|
||||
# uses "device-logs.log"
|
||||
if "watch_logs" not in path and "pebble.log" not in path and "device-logs" not in path:
|
||||
# Not a watch_logs... file
|
||||
|
@ -505,7 +505,7 @@ class ParseMinuteStatsFile(object):
|
|||
print(" // The unit tests parse the //> TEST_.* lines below for test values")
|
||||
print(" //> TEST_NAME %s" % (self.sample_prefix))
|
||||
print(SLEEP_DEFAULT_EXPECTED_TEXT)
|
||||
print(" // list of: {steps, orientation, vmc, ligh}")
|
||||
print(" // list of: {steps, orientation, vmc, light}")
|
||||
print(" static AlgDlsMinuteData samples[] = {")
|
||||
|
||||
else:
|
||||
|
|
|
@ -28,7 +28,7 @@ def contains(a, b):
|
|||
|
||||
def claim(c, unclaimed_regions, symbol):
|
||||
""" Removes region (c_start, c_end) from the set of unclaimed_regions
|
||||
Return True if the region was sucessfully removed, False if it was
|
||||
Return True if the region was successfully removed, False if it was
|
||||
already claimed.
|
||||
|
||||
"""
|
||||
|
|
|
@ -168,7 +168,7 @@ function renderJson(root) {
|
|||
// Aggregate the values for internal nodes. This is normally done by the
|
||||
// treemap layout, but not here because of our custom implementation.
|
||||
// We also take a snapshot of the original children (_children) to avoid
|
||||
// the children being overwritten when when layout is computed.
|
||||
// the children being overwritten when layout is computed.
|
||||
function accumulate(d) {
|
||||
return (d._children = d.children)
|
||||
? d.value = d.children.reduce(function(p, v) { return p + accumulate(v); }, 0)
|
||||
|
|
|
@ -28,7 +28,7 @@ class PebbleAppHeader(object):
|
|||
|
||||
# 116 bytes
|
||||
V1_STRUCT_VERSION = (0x08, 0x01)
|
||||
V1_STRUCT_DEFINTION = [
|
||||
V1_STRUCT_DEFINITION = [
|
||||
# format, name, deserialization transform, serialization transform
|
||||
('B', 'sdk_version_major', None, None),
|
||||
('B', 'sdk_version_minor', None, None),
|
||||
|
@ -49,9 +49,9 @@ class PebbleAppHeader(object):
|
|||
|
||||
# 120 bytes
|
||||
V2_STRUCT_VERSION = (0x10, 0x00)
|
||||
V2_STRUCT_DEFINTION = list(V1_STRUCT_DEFINTION)
|
||||
del V2_STRUCT_DEFINTION[12] # relocation list was dropped in v2.x
|
||||
V2_STRUCT_DEFINTION += [
|
||||
V2_STRUCT_DEFINITION = list(V1_STRUCT_DEFINITION)
|
||||
del V2_STRUCT_DEFINITION[12] # relocation list was dropped in v2.x
|
||||
V2_STRUCT_DEFINITION += [
|
||||
('I', 'resource_crc', None, None),
|
||||
('I', 'resource_timestamp', None, None),
|
||||
('H', 'virtual_size', None, None),
|
||||
|
@ -59,8 +59,8 @@ class PebbleAppHeader(object):
|
|||
V2_HEADER_LENGTH = 10 + 120
|
||||
|
||||
DEFINITION_MAP = {
|
||||
V1_STRUCT_VERSION: V1_STRUCT_DEFINTION,
|
||||
V2_STRUCT_VERSION: V2_STRUCT_DEFINTION,
|
||||
V1_STRUCT_VERSION: V1_STRUCT_DEFINITION,
|
||||
V2_STRUCT_VERSION: V2_STRUCT_DEFINITION,
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -36,7 +36,7 @@ class ApplibType(object):
|
|||
def get_total_3x_padding(self, all_types):
|
||||
""" Return the amount of padding to use for the 3x version of the struct including both
|
||||
the direct padding we add for this struct in particular as well as all padding needed
|
||||
for all dependenant structs.
|
||||
for all dependent structs.
|
||||
"""
|
||||
|
||||
if self.total_3x_padding is not None:
|
||||
|
|
|
@ -281,7 +281,7 @@ clar_usage(const char *arg)
|
|||
printf(" -q \t\tOnly report tests that had an error\n");
|
||||
printf(" -Q \t\tQuit as soon as a test fails\n");
|
||||
printf(" -l \t\tPrint suite, category, and test names\n");
|
||||
printf(" -tXX\t\tRun a specifc test by name\n");
|
||||
printf(" -tXX\t\tRun a specific test by name\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class PebbleCommander(object):
|
|||
`PebbleCommander` as the first argument, and the rest of the argument strings
|
||||
as subsequent arguments. For errors, `fn` should throw an exception.
|
||||
|
||||
# TODO: Probably make the return something structured instead of stringly typed.
|
||||
# TODO: Probably make the return something structured instead of strongly typed.
|
||||
"""
|
||||
def decorator(fn):
|
||||
# Story time:
|
||||
|
@ -136,7 +136,7 @@ class PebbleCommander(object):
|
|||
|
||||
def send_prompt_command(self, cmd):
|
||||
""" Send a prompt command string.
|
||||
Unfortunately this is indeed stringly typed, a better solution is necessary.
|
||||
Unfortunately this is indeed strongly typed, a better solution is necessary.
|
||||
"""
|
||||
return self.connection.prompt.command_and_response(cmd)
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ def deploy_bundle(bundle_path, bucket, stage, notes_path, layouts_path=None, dry
|
|||
with open(notes_path, 'r') as f:
|
||||
deploy_manifest['notes'] = f.read().strip()
|
||||
|
||||
# Fetch the current lastest.json
|
||||
# Fetch the current latest.json
|
||||
latest_key = _build_s3_path(board, stage, 'latest.json')
|
||||
r = requests.get(_build_s3_url(bucket, latest_key))
|
||||
if r.status_code == 403:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Pebble Font Renderer Script
|
||||
===========================
|
||||
|
||||
These Python scripts take TrueType font files, renders a set of glyps and outputs them into .h files in the appropriate structure for consumption by Pebble's text rendering routines.
|
||||
These Python scripts take TrueType font files, renders a set of glyphs and outputs them into .h files in the appropriate structure for consumption by Pebble's text rendering routines.
|
||||
|
||||
Requirements:
|
||||
-------------
|
||||
|
|
|
@ -23,7 +23,7 @@ import stm32_crc
|
|||
|
||||
class PebbleFirmwareBinaryInfo(object):
|
||||
V1_STRUCT_VERSION = 1
|
||||
V1_STRUCT_DEFINTION = [
|
||||
V1_STRUCT_DEFINITION = [
|
||||
('20s', 'build_id'),
|
||||
('L', 'version_timestamp'),
|
||||
('32s', 'version_tag'),
|
||||
|
@ -67,7 +67,7 @@ class PebbleFirmwareBinaryInfo(object):
|
|||
|
||||
def _get_footer_struct(self):
|
||||
fmt = '<' + reduce(lambda s, t: s + t[0],
|
||||
PebbleFirmwareBinaryInfo.V1_STRUCT_DEFINTION, '')
|
||||
PebbleFirmwareBinaryInfo.V1_STRUCT_DEFINITION, '')
|
||||
return struct.Struct(fmt)
|
||||
|
||||
def _get_footer_data_from_elf(self, path):
|
||||
|
@ -85,7 +85,7 @@ class PebbleFirmwareBinaryInfo(object):
|
|||
return footer_data
|
||||
|
||||
def _parse_footer_data(self, footer_data):
|
||||
z = zip(PebbleFirmwareBinaryInfo.V1_STRUCT_DEFINTION,
|
||||
z = zip(PebbleFirmwareBinaryInfo.V1_STRUCT_DEFINITION,
|
||||
self.struct.unpack(footer_data))
|
||||
return {entry[1]: data for entry, data in z}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ PRESERVE_SYMBOLS = [
|
|||
'app_crashed',
|
||||
]
|
||||
|
||||
# I have NO idea why we need to preserve `g_default_draw_implementation`, but we do. It's bizzare.
|
||||
# I have NO idea why we need to preserve `g_default_draw_implementation`, but we do. It's bizarre.
|
||||
# We can at least obfuscate the name.
|
||||
OBFUSCATE_SYMBOLS = [
|
||||
'g_default_draw_implementation',
|
||||
|
@ -69,10 +69,10 @@ class ELFFileHeader(ELFObjectBase):
|
|||
elf_class = None # The class of the ELF file (whether it's 32-bit or 64-bit)
|
||||
data = None # The format of the data in the ELF file (endianness)
|
||||
version = None # The version of the ELF file format
|
||||
osabi = None # The OS- or ABI-specific extensios used in this ELF file
|
||||
osabi = None # The OS- or ABI-specific extensions used in this ELF file
|
||||
abi_version = None # The version of the ABI this file is targeted for
|
||||
type = None # The object file type
|
||||
machine = None # The machine artictecture
|
||||
machine = None # The machine architecture
|
||||
entry = None # The program entry point
|
||||
ph_offset = None # The offset of the program header table in bytes
|
||||
sh_offset = None # The offset of the section header table in bytes
|
||||
|
@ -90,7 +90,7 @@ class ELFFileHeader(ELFObjectBase):
|
|||
assert(self.elf_class == self.CLASS_32_BIT)
|
||||
# we only support little-endian files
|
||||
assert(self.data == self.DATA_2_LSB)
|
||||
# current ELF verison
|
||||
# current ELF version
|
||||
assert(self.version == self.VERSION)
|
||||
assert(self.osabi == self.OS_ABI)
|
||||
assert(self.abi_version == self.ABI_VERSION)
|
||||
|
@ -140,7 +140,7 @@ class ELFSectionHeader(ELFObjectBase):
|
|||
size = None # The size of the section in bytes
|
||||
link = None # The section header table link (interpretation various based on type)
|
||||
info = None # Extra info
|
||||
addr_align = None # Address alignment contraint for the section
|
||||
addr_align = None # Address alignment constraint for the section
|
||||
entry_size = None # The size of entries within the section in bytes (if applicable)
|
||||
|
||||
def unpack(self, data, offset=0):
|
||||
|
@ -434,7 +434,7 @@ def obfuscate(src_path, dst_path, no_text):
|
|||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Pebble Firmware ELF Obfuscation')
|
||||
parser.add_argument('input_elf', help='The source ELF file to be obfuscaated')
|
||||
parser.add_argument('input_elf', help='The source ELF file to be obfuscated')
|
||||
parser.add_argument('output_elf', help='Output file path')
|
||||
parser.add_argument('--no-text', help='Removes the .text section', action='store_true')
|
||||
args = parser.parse_args()
|
||||
|
|
|
@ -441,7 +441,7 @@ class StackRecover(gdb.Command):
|
|||
|
||||
def __init__(self):
|
||||
super(StackRecover, self).__init__('pbl stackwizard', gdb.COMMAND_USER)
|
||||
desc = "Attempts to recover a backtrace from a corrupted stack (i.e stack oveflow)"
|
||||
desc = "Attempts to recover a backtrace from a corrupted stack (i.e stack overflow)"
|
||||
self.parser = gdb_utils.GdbArgumentParser(prog='pbl stackwizard', description=desc)
|
||||
|
||||
def print_usage(self):
|
||||
|
|
|
@ -75,6 +75,6 @@ Each exported symbol in the `exports` table is formatted as follows:
|
|||
When adding new functions, make sure to bump up the `revision` field, and use that value as the new functions' `addedRevision` field. This guarantees that new versions of TintinOS are backwards compatible when compiled against older `libpebble.a`. Seriously, ***make sure to do this***!!.
|
||||
|
||||
## Bugs
|
||||
+ The script doesn't check the the resulting `pebble.h` file will compile, that is left as an exercise to the reader.
|
||||
+ The script doesn't check the resulting `pebble.h` file will compile, that is left as an exercise to the reader.
|
||||
+ The script's error reporting is a little funky/unfriendly in places
|
||||
+ The script does not do any checking of the function revision numbers, beyond a simple check that the file's revision is not lower than any function's.
|
||||
|
|
|
@ -414,7 +414,7 @@ def cmd_firmware(args):
|
|||
make_firmware_bundle(**vars(args))
|
||||
|
||||
def cmd_watchapp(args):
|
||||
args.sdk_verison = dict(zip(['major', 'minor'], [int(x) for x in args.sdk_version.split('.')]))
|
||||
args.sdk_version = dict(zip(['major', 'minor'], [int(x) for x in args.sdk_version.split('.')]))
|
||||
|
||||
make_watchapp_bundle(**vars(args))
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ NUM_SUBREGIONS = 8
|
|||
|
||||
|
||||
def round_up_to_power_of_two(x):
|
||||
""" Find the next power of two that is eqaul to or greater than x
|
||||
""" Find the next power of two that is equal to or greater than x
|
||||
|
||||
>>> round_up_to_power_of_two(4)
|
||||
4
|
||||
|
@ -63,7 +63,7 @@ def find_subregions_for_region(address, size):
|
|||
smallest_block_size = max(round_up_to_power_of_two(size), MIN_REGION_SIZE)
|
||||
largest_block_size = min(round_up_to_power_of_two(size * NUM_SUBREGIONS), MAX_REGION_SIZE)
|
||||
|
||||
# Iterate over the potentional candidates from smallest to largest
|
||||
# Iterate over the potential candidates from smallest to largest
|
||||
current_block_size = smallest_block_size
|
||||
while current_block_size <= largest_block_size:
|
||||
subregion_size = current_block_size // NUM_SUBREGIONS
|
||||
|
@ -76,9 +76,9 @@ def find_subregions_for_region(address, size):
|
|||
end_in_block <= current_block_size):
|
||||
|
||||
# This region fits in the provided region and both the start and end are aligned with
|
||||
# subregion boundries. This will work!
|
||||
# subregion boundaries. This will work!
|
||||
|
||||
block_start_addresss = address - start_in_block
|
||||
block_start_address = address - start_in_block
|
||||
|
||||
start_enabled_subregion = start_in_block / subregion_size
|
||||
end_enabled_subregion = end_in_block / subregion_size
|
||||
|
@ -90,7 +90,7 @@ def find_subregions_for_region(address, size):
|
|||
disabled_subregions_bytes = disabled_subregions.tobytes()
|
||||
disabled_subregions_int, = struct.unpack('B', disabled_subregions_bytes)
|
||||
|
||||
return MpuRegion(block_start_addresss, current_block_size, disabled_subregions_int)
|
||||
return MpuRegion(block_start_address, current_block_size, disabled_subregions_int)
|
||||
|
||||
current_block_size *= 2
|
||||
else:
|
||||
|
|
|
@ -47,7 +47,7 @@ class EraseCommand(object):
|
|||
if unpacked.address != self.address or unpacked.length != self.length:
|
||||
raise exceptions.ResponseParseError(
|
||||
'Response does not match command: '
|
||||
'address=%#.08x legnth=%d (expected %#.08x, %d)' % (
|
||||
'address=%#.08x length=%d (expected %#.08x, %d)' % (
|
||||
unpacked.address, unpacked.length, self.address,
|
||||
self.length))
|
||||
return unpacked
|
||||
|
@ -110,7 +110,7 @@ class CrcCommand(object):
|
|||
if unpacked.address != self.address or unpacked.length != self.length:
|
||||
raise exceptions.ResponseParseError(
|
||||
'Response does not match command: '
|
||||
'address=%#.08x legnth=%d (expected %#.08x, %d)' % (
|
||||
'address=%#.08x length=%d (expected %#.08x, %d)' % (
|
||||
unpacked.address, unpacked.length, self.address,
|
||||
self.length))
|
||||
return unpacked
|
||||
|
|
|
@ -23,7 +23,7 @@ created in the Pebble.
|
|||
This proxy talks to the QEMU gdb server using primitive gdb remote commands and inspects the
|
||||
FreeRTOS task structures to figure out which threads have been created, their saved registers, etc.
|
||||
and then returns that information to gdb when it asks for thread info from the target system. For
|
||||
most other requests recevied from gdb, this proxy simply acts as a passive pass thru to the QEMU gdb
|
||||
most other requests received from gdb, this proxy simply acts as a passive pass thru to the QEMU gdb
|
||||
server.
|
||||
|
||||
This module is designed to be run as a separate process from both QEMU and gdb. It connects to the
|
||||
|
@ -694,7 +694,7 @@ if __name__ == '__main__':
|
|||
# Collect our command line arguments
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument('--port', type=int, default=1233,
|
||||
help="Port to accept incomming connections on")
|
||||
help="Port to accept incoming connections on")
|
||||
parser.add_argument('--target', default='localhost:1234',
|
||||
help="target to connect to ")
|
||||
parser.add_argument('--connect_timeout', type=float, default=1.0,
|
||||
|
|
|
@ -31,7 +31,7 @@ class ResourceGeneratorMetaclass(type):
|
|||
if cls.type:
|
||||
_ResourceGenerators[cls.type] = cls
|
||||
|
||||
# Instatiate the metaclass into a baseclass we can use elsewhere.
|
||||
# Instantiate the metaclass into a baseclass we can use elsewhere.
|
||||
ResourceGeneratorBase = ResourceGeneratorMetaclass('ResourceGenerator', (object,), {})
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@ class ResourceGenerator(ResourceGeneratorBase):
|
|||
'filename': str(definition_dict['file'] if 'file' in definition_dict else None)}
|
||||
resources = [resource]
|
||||
|
||||
# Now generate ResourceDefintion objects for each resource
|
||||
# Now generate ResourceDefinition objects for each resource
|
||||
target_platforms = definition_dict.get('targetPlatforms', None)
|
||||
aliases = definition_dict.get('aliases', [])
|
||||
builtin = False if bld.variant == 'applib' else definition_dict.get('builtin', False)
|
||||
|
|
|
@ -25,7 +25,7 @@ from log_hashing.check_elf_log_strings import check_dict_log_strings
|
|||
|
||||
class TestCheckLogStrings(unittest.TestCase):
|
||||
|
||||
def test_some_acceptible_strings(self):
|
||||
def test_some_acceptable_strings(self):
|
||||
log_dict = {
|
||||
1: {'file': 'test.c', 'line': '1', 'msg': 'test %s'},
|
||||
2: {'file': 'test.c', 'line': '2', 'msg': 'test %-2hx'},
|
||||
|
|
|
@ -102,7 +102,7 @@ class TestDeployPbzToPebbleFw(unittest.TestCase):
|
|||
|
||||
def boto_key_func(boto_bucket, key):
|
||||
if key == 'pebble/bb2/porksmoothie/latest.json':
|
||||
# Only validate us uploading to latest.json and return unamed mocks for the other
|
||||
# Only validate us uploading to latest.json and return unnamed mocks for the other
|
||||
# paths.
|
||||
return mock_latest_key
|
||||
|
||||
|
|
|
@ -481,7 +481,7 @@ class MyTestCase(unittest.TestCase):
|
|||
self.assertTrue(open_path_command.open)
|
||||
|
||||
def test_parse_json_sequence(self):
|
||||
# Test mix of fills and open paths with mulitple frames
|
||||
# Test mix of fills and open paths with multiple frames
|
||||
current_path = os.path.dirname(os.path.realpath(__file__))
|
||||
filename = current_path + '/json2commands_test.json'
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ def text_to_req_list(req_list_text):
|
|||
req_list.append((line, None, None))
|
||||
continue
|
||||
if match.group('package').endswith(','):
|
||||
# Muliple requirements
|
||||
# Multiple requirements
|
||||
match2 = VERSION_PATTERN.match(match.group('package').strip(','))
|
||||
if not match2:
|
||||
Logs.pprint('RED', 'Don\'t understand line \'%s\'' % raw_line)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue