mirror of
https://github.com/google/pebble.git
synced 2025-04-24 05:27:07 -04:00
Merge ecfd50f991
into 4051c5bb97
This commit is contained in:
commit
74b93756f3
516 changed files with 1078 additions and 1078 deletions
|
@ -558,7 +558,7 @@ jerry_size_t jerry_object_to_string_to_utf8_char_buffer(const jerry_value_t obje
|
|||
return len;
|
||||
}
|
||||
|
||||
// FIXME: PBL-43551 Propery CESU-8 => UTF-8 conversion.
|
||||
// FIXME: PBL-43551 Property CESU-8 => UTF-8 conversion.
|
||||
jerry_size_t jerry_object_to_string_to_char_buffer(const jerry_value_t object,
|
||||
jerry_char_t *buffer_p,
|
||||
jerry_size_t buffer_size) {
|
||||
|
|
|
@ -160,7 +160,7 @@ static bool prv_get_resource(uint32_t resource_id, Resource *res) {
|
|||
if ((entry.resource_id != resource_id) ||
|
||||
(entry.length == 0)) {
|
||||
// empty resource
|
||||
printf("%s: Invalid resourcel for %d\n", __FILE__, resource_id);
|
||||
printf("%s: Invalid resource for %d\n", __FILE__, resource_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "resource/resource.h"
|
||||
|
||||
// transformed to int to avoid surpises between C->JS
|
||||
// transformed to int to avoid surprises between C->JS
|
||||
typedef int (*ResourceReadCb)(int offset, uint8_t *buf, int num_bytes);
|
||||
typedef int (*ResourceGetSizeCb)(void);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace std {
|
|||
}
|
||||
|
||||
/* This analyzer suffers from the major limitation that most of the mutexes in Pebble are globals,
|
||||
* so all symbols and MemRegions refering to the mutexes are invalidated every time an unknown
|
||||
* so all symbols and MemRegions referring to the mutexes are invalidated every time an unknown
|
||||
* function is called. This analyzer instead associates mutexes with the declaration of their
|
||||
* variables, which has the obvious limitation of not catching when mutexes are passed as
|
||||
* arguments (which fortunately never? happens in pebble).
|
||||
|
|
|
@ -191,11 +191,11 @@ This function affects subsequent calls to \ref rand() to produce a sequence of n
|
|||
`setlocale` can be used to:
|
||||
- set the app's locale to a specific locale: `setlocale(LC_ALL, "en_CA")`
|
||||
- set the app's locale to the system locale: `setlocale(LC_ALL, "")`
|
||||
- get the app's curent locale: `setlocale(LC_ALL, NULL)`
|
||||
- get the app's current locale: `setlocale(LC_ALL, NULL)`
|
||||
|
||||
\param category The category of routines for which to set the locale
|
||||
\param locale The ISO formatted locale to use, or "" for the system locale
|
||||
\return the locale after the change is applied, NULL on failure (e.g. unsuported category)
|
||||
\return the locale after the change is applied, NULL on failure (e.g. unsupported category)
|
||||
\note Currently, we only support two categories: LC_ALL and LC_TIME
|
||||
|
||||
@}
|
||||
|
@ -421,7 +421,7 @@ original allocation or the new size into the newly allocated buffer.
|
|||
\return The destination buffer dest
|
||||
|
||||
\fn char *strncat(char *dest, const char *src, size_t n)
|
||||
\brief Concatenates up to n bytes from the string in src to the end of the string pointed by dest and null terminates dest. There should be no overlap of dest and src in memeory.
|
||||
\brief Concatenates up to n bytes from the string in src to the end of the string pointed by dest and null terminates dest. There should be no overlap of dest and src in memory.
|
||||
\param dest The destination buffer with enough space for src beyond the null character
|
||||
\param src The source string
|
||||
\param n The maximum number of bytes to copy
|
||||
|
|
|
@ -100,7 +100,7 @@ with the target address and data. The receiver performs the write and
|
|||
sends an acknowledgement with the address. If the sender doesn't receive
|
||||
an acknowledgement within some timeout, it re-sends the write command.
|
||||
Any number of write commands and acknowledgements can be in-flight
|
||||
simulatneously. If a write completes but the acknowledgement is lost in
|
||||
simultaneously. If a write completes but the acknowledgement is lost in
|
||||
transit, the sender can re-send the same write command and the receiver
|
||||
can naively overwrite the data without issue due to the idempotence of
|
||||
flash writes.
|
||||
|
@ -149,7 +149,7 @@ Applications can choose to communicate with either best-effort datagram
|
|||
service (like PULSEv1), or reliable datagram service that guarantees
|
||||
in-order datagram delivery. Having the reliable transport available
|
||||
made it very easy to implement prompt commands over PULSEv2. And it was
|
||||
also suprisingly easy to implement a PULSEv2 transport for the Pebble
|
||||
also surprisingly easy to implement a PULSEv2 transport for the Pebble
|
||||
Protocol, which allows developers and test automation to interact with
|
||||
bigboards using libpebble2 and pebble-tool, exactly like they can with
|
||||
emulators and sealed watches connected to phones.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FreeRTOS lets us create tasks, which are independant threads of execution. We create a few ourselves, and more are created internally by FreeRTOS. We have pre-emption enabled in our FreeRTOS configuration, so we must be mindful of which other tasks are mucking with the same data. This document describes the tasks that exist in our system.
|
||||
FreeRTOS lets us create tasks, which are independent threads of execution. We create a few ourselves, and more are created internally by FreeRTOS. We have pre-emption enabled in our FreeRTOS configuration, so we must be mindful of which other tasks are mucking with the same data. This document describes the tasks that exist in our system.
|
||||
|
||||
FreeRTOS Tasks
|
||||
==============
|
||||
|
@ -10,7 +10,7 @@ Timers that are registered using our timer infrastructure are executed on this t
|
|||
|
||||
"IDLE" - The idle task
|
||||
----------------------
|
||||
This is a special task used by the FreeRTOS scheduler. It's defined at it's own priority level which is at the lowest priority. If no other task is ready to run, either due to waiting on a semaphore or waiting using vTaskDelay (or something like that), the idle task is chosen to run instead.
|
||||
This is a special task used by the FreeRTOS scheduler. It's defined at its own priority level which is at the lowest priority. If no other task is ready to run, either due to waiting on a semaphore or waiting using vTaskDelay (or something like that), the idle task is chosen to run instead.
|
||||
|
||||
We have modified FreeRTOS such that if we're in the idle task, we enter a lower power mode, either sleep or stop. Stop mode is special in that peripheral clocks are shut down when we go into stop and are not automatically turned back on when we leave stop mode. This means we have to go through and turn them all back on. This is what the `register_stop_mode_resume_callback` function does. It allows individual drivers to register callbacks that are called when we leave stop from the idle thread. This comes with a caveat though. Since the idle thread only ever runs when there's nothing else to run, the scheduler assumes that there is always a task to run. This means that if the idle task is stopped or delayed for any reason, the scheduler will explode. Therefore you are not permitted to do operations that may stop the task's execution from within the resume callback.
|
||||
|
||||
|
@ -34,4 +34,4 @@ This task is created for the currently running app. No task is created for the l
|
|||
Open Questions
|
||||
==============
|
||||
|
||||
Which tasks are allowed to manipulate the window state? What if the launcher wants to push a notification window at the same time as an app pushes it's own window?
|
||||
Which tasks are allowed to manipulate the window state? What if the launcher wants to push a notification window at the same time as an app pushes its own window?
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This script works around an issue in MacOS 10.9 (Mavericks) that causes
|
||||
# This script works around an issue in macOS 10.9 (Mavericks) that causes
|
||||
# it to go back to the original Apple USB FTDI drivers after a reboot.
|
||||
sudo kextunload /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBFTDI.kext
|
||||
sudo kextcache -system-prelinked-kernel
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This script works around an issue in MacOS 10.9 (Mavericks) that causes
|
||||
# This script works around an issue in macOS 10.9 (Mavericks) that causes
|
||||
# it to go back to the original Apple USB FTDI drivers after a reboot.
|
||||
sudo kextunload /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBFTDI.kext
|
||||
sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#define GPIO_Port_NULL ((GPIO_TypeDef *) 0)
|
||||
#define GPIO_Pin_NULL ((uint16_t)0x0000)
|
||||
|
||||
// This is generated in order to faciliate the check within the IRQ_MAP macro below
|
||||
// This is generated in order to facilitate the check within the IRQ_MAP macro below
|
||||
enum {
|
||||
#define IRQ_DEF(num, irq) IS_VALID_IRQ__##irq,
|
||||
#include "irq_stm32f7.def"
|
||||
|
|
|
@ -140,7 +140,7 @@ void display_init(void) {
|
|||
|
||||
// Work around an issue which some boards exhibit where the FPGA ring
|
||||
// oscillator can start up with higher harmonics, massively overclocking the
|
||||
// design and causing malfunction. When this occurrs, the draw-scene command
|
||||
// design and causing malfunction. When this occurs, the draw-scene command
|
||||
// will not work, asserting BUSY indefinitely but never updating the display.
|
||||
// Other commands such as display-on and display-off are less affected by the
|
||||
// overclocking, so the display can be turned on while the FPGA is in this
|
||||
|
|
|
@ -239,7 +239,7 @@ bool pmic_enable_battery_measure(void) {
|
|||
bool pmic_disable_battery_measure(void) {
|
||||
bool result = prv_set_mon_config_register(0);
|
||||
|
||||
// Releases the lock that was previously aquired in pmic_enable_battery_measure.
|
||||
// Releases the lock that was previously acquired in pmic_enable_battery_measure.
|
||||
prv_mon_config_unlock();
|
||||
|
||||
return result;
|
||||
|
|
|
@ -138,7 +138,7 @@ void fw_copy_check_update_fw(void) {
|
|||
if (boot_bit_test(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS)) {
|
||||
dbgserial_putstr("Our previous firmware update failed, aborting update.");
|
||||
|
||||
// Pretend like the new firmware bit wasn't set afterall. We'll just run the
|
||||
// Pretend like the new firmware bit wasn't set after all. We'll just run the
|
||||
// previous code, whether that was normal firmware or the recovery firmware.
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS);
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_AVAILABLE);
|
||||
|
@ -165,7 +165,7 @@ void fw_copy_check_update_fw(void) {
|
|||
break;
|
||||
case UPDATE_FW_ERROR_MICRO_FLASH_MANGLED:
|
||||
// We've broken our internal flash when trying to update our normal
|
||||
// firmware. Fall back immediately to the recovery firmare.
|
||||
// firmware. Fall back immediately to the recovery firmware.
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_ONE);
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_TWO);
|
||||
system_reset();
|
||||
|
|
|
@ -70,28 +70,28 @@ SECTIONS
|
|||
It is one task of the startup to copy the initial values from FLASH to RAM. */
|
||||
.data : {
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
/* This is used by the startup in order to initialize the .data section */
|
||||
__data_start = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
__data_end = .; /* This is used by the startup in order to initialize the .data secion */
|
||||
__data_end = .; /* This is used by the startup in order to initialize the .data section */
|
||||
} >RAM AT>FLASH
|
||||
__data_load_start = LOADADDR(.data);
|
||||
|
||||
/* This is the uninitialized data section */
|
||||
.bss (NOLOAD) : {
|
||||
. = ALIGN(4);
|
||||
__bss_start = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
__bss_start = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_end = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
__bss_end = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
} >RAM
|
||||
|
||||
.stack (NOLOAD) : {
|
||||
|
|
|
@ -39,7 +39,7 @@ void delay_us(uint32_t us) {
|
|||
|
||||
void delay_ms(uint32_t millis) {
|
||||
// delay_us(millis*1000) is not used because a long delay could easily
|
||||
// overflow the veriable. Without the outer loop, a delay of even five
|
||||
// overflow the variable. Without the outer loop, a delay of even five
|
||||
// seconds would overflow.
|
||||
while (millis--) {
|
||||
delay_us(1000);
|
||||
|
|
|
@ -64,7 +64,7 @@ int ceil_log_two(uint32_t n);
|
|||
)
|
||||
|
||||
/**
|
||||
* Compute the next backoff interval using a bounded binary expoential backoff formula.
|
||||
* Compute the next backoff interval using a bounded binary exponential backoff formula.
|
||||
*
|
||||
* @param[in,out] attempt The number of retries performed so far. This count will be incremented
|
||||
* by the function.
|
||||
|
|
|
@ -53,7 +53,7 @@ __attribute__((__noreturn__)) void Default_Handler(void) {
|
|||
|
||||
// All these functions are weak references to the Default_Handler,
|
||||
// so if we define a handler in elsewhere in the firmware, these
|
||||
// will be overriden
|
||||
// will be overridden
|
||||
#define ALIAS(sym) __attribute__((__weak__, __alias__(sym)))
|
||||
ALIAS("Default_Handler") void NMI_Handler(void);
|
||||
ALIAS("Default_Handler") void HardFault_Handler(void);
|
||||
|
|
|
@ -97,7 +97,7 @@ def process_binary_header(self):
|
|||
sparse length encoding (see waftools/sparse_length_encoding.py).
|
||||
|
||||
The name of the array variable defaults to the source file name with all
|
||||
characters that are invaid C identifiers replaced with underscores. The name
|
||||
characters that are invalid C identifiers replaced with underscores. The name
|
||||
can be explicitly specified by setting the *array_name* parameter.
|
||||
|
||||
This method overrides the processing by
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
"""
|
||||
Support for converting linked targets to ihex, srec or binary files using
|
||||
objcopy. Use the 'objcopy' feature in conjuction with the 'cc' or 'cxx'
|
||||
objcopy. Use the 'objcopy' feature in conjunction with the 'cc' or 'cxx'
|
||||
feature. The 'objcopy' feature uses the following attributes:
|
||||
|
||||
objcopy_bfdname Target object format name (eg. ihex, srec, binary).
|
||||
|
|
|
@ -58,8 +58,8 @@ def encode(source):
|
|||
frequency.update(source)
|
||||
# most_common() doesn't define what happens if there's a tie in frequency. Let's always pick
|
||||
# the lowest value of that frequency to make the encoding predictable.
|
||||
occurences = frequency.most_common()
|
||||
escape = min(x[0] for x in occurences if x[1] == occurences[-1][1])
|
||||
occurrences = frequency.most_common()
|
||||
escape = min(x[0] for x in occurrences if x[1] == occurrences[-1][1])
|
||||
yield escape
|
||||
for b, g in groupby(source):
|
||||
if b == b'\0':
|
||||
|
|
|
@ -24,7 +24,7 @@ def options(opt):
|
|||
help='Which board to build for (robert_bb, robert_bb2, cutts_bb, robert_evt)')
|
||||
opt.add_option('--nowatchdog', action='store_true',
|
||||
help='Disable automatic reboots when watchdog fires')
|
||||
opt.add_option('--display_test', action='store_true', help='Enables the diplsay test loop')
|
||||
opt.add_option('--display_test', action='store_true', help='Enables the display test loop')
|
||||
|
||||
|
||||
def configure(conf):
|
||||
|
|
|
@ -143,7 +143,7 @@ void check_update_fw(void) {
|
|||
if (boot_bit_test(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS)) {
|
||||
dbgserial_putstr("Our previous firmware update failed, aborting update.");
|
||||
|
||||
// Pretend like the new firmware bit wasn't set afterall. We'll just run the
|
||||
// Pretend like the new firmware bit wasn't set after all. We'll just run the
|
||||
// previous code, whether that was normal firmware or the recovery firmware.
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS);
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_AVAILABLE);
|
||||
|
@ -170,7 +170,7 @@ void check_update_fw(void) {
|
|||
break;
|
||||
case UPDATE_FW_ERROR_MICRO_FLASH_MANGLED:
|
||||
// We've broken our internal flash when trying to update our normal
|
||||
// firmware. Fall back immediately to the recovery firmare.
|
||||
// firmware. Fall back immediately to the recovery firmware.
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_ONE);
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_TWO);
|
||||
system_reset();
|
||||
|
|
|
@ -16,7 +16,7 @@ PROVIDE ( _Stack_Size = __Stack_Size ) ;
|
|||
|
||||
__Stack_Init = _estack - __Stack_Size ;
|
||||
|
||||
/*"PROVIDE" allows to easily override these values from an object file or the commmand line.*/
|
||||
/*"PROVIDE" allows to easily override these values from an object file or the command line.*/
|
||||
PROVIDE ( _Stack_Init = __Stack_Init ) ;
|
||||
|
||||
/*
|
||||
|
@ -96,28 +96,28 @@ SECTIONS
|
|||
.data : AT ( _sidata )
|
||||
{
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
/* This is used by the startup in order to initialize the .data section */
|
||||
_sdata = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
_edata = .; /* This is used by the startup in order to initialize the .data secion */
|
||||
_edata = .; /* This is used by the startup in order to initialize the .data section */
|
||||
} >RAM
|
||||
|
||||
/* This is the uninitialized data section */
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sbss = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
_sbss = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
_ebss = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
_ebss = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
} >RAM
|
||||
|
||||
.stack :
|
||||
|
|
|
@ -41,7 +41,7 @@ void NOINLINE delay_us(uint32_t us) {
|
|||
|
||||
void delay_ms(uint32_t millis) {
|
||||
// delay_us(millis*1000) is not used because a long delay could easily
|
||||
// overflow the veriable. Without the outer loop, a delay of even five
|
||||
// overflow the variable. Without the outer loop, a delay of even five
|
||||
// seconds would overflow.
|
||||
while (millis--) {
|
||||
delay_us(1000);
|
||||
|
|
|
@ -85,7 +85,7 @@ def process_binary_header(self):
|
|||
file is treated as a raw binary file.
|
||||
|
||||
The name of the array variable defaults to the source file name with all
|
||||
characters that are invaid C identifiers replaced with underscores. The name
|
||||
characters that are invalid C identifiers replaced with underscores. The name
|
||||
can be explicitly specified by setting the *array_name* parameter.
|
||||
|
||||
This method overrides the processing by
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
"""
|
||||
Support for converting linked targets to ihex, srec or binary files using
|
||||
objcopy. Use the 'objcopy' feature in conjuction with the 'cc' or 'cxx'
|
||||
objcopy. Use the 'objcopy' feature in conjunction with the 'cc' or 'cxx'
|
||||
feature. The 'objcopy' feature uses the following attributes:
|
||||
|
||||
objcopy_bfdname Target object format name (eg. ihex, srec, binary).
|
||||
|
|
|
@ -171,7 +171,7 @@ void display_power_disable(void) {
|
|||
|
||||
//!
|
||||
//! Write a single byte synchronously to the display. Use this
|
||||
//! sparingly, as it will tie up the micro duing the write.
|
||||
//! sparingly, as it will tie up the micro during the write.
|
||||
//!
|
||||
void display_write_byte(uint8_t d) {
|
||||
// Block until the tx buffer is empty
|
||||
|
|
|
@ -224,7 +224,7 @@ void display_init(void) {
|
|||
|
||||
// Work around an issue which some boards exhibit where the FPGA ring
|
||||
// oscillator can start up with higher harmonics, massively overclocking the
|
||||
// design and causing malfunction. When this occurrs, the draw-scene command
|
||||
// design and causing malfunction. When this occurs, the draw-scene command
|
||||
// will not work, asserting BUSY indefinitely but never updating the display.
|
||||
// Other commands such as display-on and display-off are less affected by the
|
||||
// overclocking, so the display can be turned on while the FPGA is in this
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "drivers/flash.h"
|
||||
|
||||
//! An address in the flash address spac
|
||||
//! An address in the flash address space
|
||||
typedef uint32_t FlashAddress;
|
||||
|
||||
//! This is the memory mapped region that's mapped to the parallel flash.
|
||||
|
@ -45,10 +45,10 @@ typedef enum S29VSCommand {
|
|||
} S29VSCommand;
|
||||
|
||||
//! Arguments to the S29VSCommand_EraseSetup command
|
||||
typedef enum S29VSCommandEraseAguments {
|
||||
S29VSCommandEraseAguments_ChipErase = 0x10,
|
||||
S29VSCommandEraseAguments_SectorErase = 0x30
|
||||
} S29VSCommandEraseAguments;
|
||||
typedef enum S29VSCommandEraseArguments {
|
||||
S29VSCommandEraseArguments_ChipErase = 0x10,
|
||||
S29VSCommandEraseArguments_SectorErase = 0x30
|
||||
} S29VSCommandEraseArguments;
|
||||
|
||||
//! The bitset stored in the status register, see flash_s29vs_read_status_register
|
||||
typedef enum S29VSStatusBit {
|
||||
|
|
|
@ -144,7 +144,7 @@ bool pmic_init(void) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If not written to whithin 5 seconds of power-on the PMIC will shut down.
|
||||
// If not written to within 5 seconds of power-on the PMIC will shut down.
|
||||
//i2c_write_register(I2C_DEVICE_MAX14690, MAX14690_ADDR, PmicRegisters_HAND_SHK, 0x01);
|
||||
|
||||
// Power up 3.2V rail
|
||||
|
@ -261,7 +261,7 @@ bool pmic_enable_battery_measure(void) {
|
|||
bool pmic_disable_battery_measure(void) {
|
||||
bool result = prv_set_mon_config_register(0);
|
||||
|
||||
// Releases the lock that was previously aquired in pmic_enable_battery_measure.
|
||||
// Releases the lock that was previously acquired in pmic_enable_battery_measure.
|
||||
prv_mon_config_unlock();
|
||||
|
||||
return result;
|
||||
|
@ -327,7 +327,7 @@ static bool prv_is_alive(void) {
|
|||
return true;
|
||||
} else {
|
||||
PBL_LOG(LOG_LEVEL_DEBUG,
|
||||
"Error: read max14690 whomai byte 0x%x, expecting 0x%x", val, 0x01);
|
||||
"Error: read max14690 whoami byte 0x%x, expecting 0x%x", val, 0x01);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#define FLASH_REGION_SYSTEM_RESOURCES_BEGIN 0x380000
|
||||
#define FLASH_REGION_SYSTEM_RESOURCES_END 0x400000 // 512k
|
||||
|
||||
// FIXME: The addresses below here are hacky work arounds and hopefully not the final place
|
||||
// FIXME: The addresses below here are hacky workarounds and hopefully not the final place
|
||||
// for these things. Hopefully many of them can move to the filesystem. Everything above here
|
||||
// should be pretty stable.
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ void check_update_fw(void) {
|
|||
if (boot_bit_test(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS)) {
|
||||
dbgserial_putstr("Our previous firmware update failed, aborting update.");
|
||||
|
||||
// Pretend like the new firmware bit wasn't set afterall. We'll just run the
|
||||
// Pretend like the new firmware bit wasn't set after all. We'll just run the
|
||||
// previous code, whether that was normal firmware or the recovery firmware.
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS);
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_AVAILABLE);
|
||||
|
@ -156,7 +156,7 @@ void check_update_fw(void) {
|
|||
break;
|
||||
case UPDATE_FW_ERROR_MICRO_FLASH_MANGLED:
|
||||
// We've broken our internal flash when trying to update our normal
|
||||
// firmware. Fall back immediately to the recovery firmare.
|
||||
// firmware. Fall back immediately to the recovery firmware.
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_ONE);
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_TWO);
|
||||
system_reset();
|
||||
|
|
|
@ -16,7 +16,7 @@ PROVIDE ( _Stack_Size = __Stack_Size ) ;
|
|||
|
||||
__Stack_Init = _estack - __Stack_Size ;
|
||||
|
||||
/*"PROVIDE" allows to easily override these values from an object file or the commmand line.*/
|
||||
/*"PROVIDE" allows to easily override these values from an object file or the command line.*/
|
||||
PROVIDE ( _Stack_Init = __Stack_Init ) ;
|
||||
|
||||
/*
|
||||
|
@ -96,28 +96,28 @@ SECTIONS
|
|||
.data : AT ( _sidata )
|
||||
{
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
/* This is used by the startup in order to initialize the .data section */
|
||||
_sdata = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
_edata = .; /* This is used by the startup in order to initialize the .data secion */
|
||||
_edata = .; /* This is used by the startup in order to initialize the .data section */
|
||||
} >RAM
|
||||
|
||||
/* This is the uninitialized data section */
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sbss = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
_sbss = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
_ebss = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
_ebss = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
} >RAM
|
||||
|
||||
.stack :
|
||||
|
|
|
@ -36,7 +36,7 @@ void delay_us(uint32_t us) {
|
|||
|
||||
void delay_ms(uint32_t millis) {
|
||||
// delay_us(millis*1000) is not used because a long delay could easily
|
||||
// overflow the veriable. Without the outer loop, a delay of even five
|
||||
// overflow the variable. Without the outer loop, a delay of even five
|
||||
// seconds would overflow.
|
||||
while (millis--) {
|
||||
delay_us(1000);
|
||||
|
|
|
@ -79,7 +79,7 @@ const char *bool_to_str(bool b);
|
|||
bool convert_bt_addr_hex_str_to_bd_addr(const char *hex_str, uint8_t *bd_addr, const unsigned int bd_addr_size);
|
||||
|
||||
/**
|
||||
* Compute the next backoff interval using a bounded binary expoential backoff formula.
|
||||
* Compute the next backoff interval using a bounded binary exponential backoff formula.
|
||||
*
|
||||
* @param[in,out] attempt The number of retries performed so far. This count will be incremented by
|
||||
* the function.
|
||||
|
|
|
@ -84,7 +84,7 @@ def process_binary_header(self):
|
|||
file is treated as a raw binary file.
|
||||
|
||||
The name of the array variable defaults to the source file name with all
|
||||
characters that are invaid C identifiers replaced with underscores. The name
|
||||
characters that are invalid C identifiers replaced with underscores. The name
|
||||
can be explicitly specified by setting the *array_name* parameter.
|
||||
|
||||
This method overrides the processing by
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
"""
|
||||
Support for converting linked targets to ihex, srec or binary files using
|
||||
objcopy. Use the 'objcopy' feature in conjuction with the 'cc' or 'cxx'
|
||||
objcopy. Use the 'objcopy' feature in conjunction with the 'cc' or 'cxx'
|
||||
feature. The 'objcopy' feature uses the following attributes:
|
||||
|
||||
objcopy_bfdname Target object format name (eg. ihex, srec, binary).
|
||||
|
|
|
@ -182,7 +182,7 @@ void check_update_fw(void) {
|
|||
if (boot_bit_test(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS)) {
|
||||
dbgserial_putstr("Our previous firmware update failed, aborting update.");
|
||||
|
||||
// Pretend like the new firmware bit wasn't set afterall. We'll just run the
|
||||
// Pretend like the new firmware bit wasn't set after all. We'll just run the
|
||||
// previous code, whether that was normal firmware or the recovery firmware.
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_UPDATE_IN_PROGRESS);
|
||||
boot_bit_clear(BOOT_BIT_NEW_FW_AVAILABLE);
|
||||
|
@ -209,7 +209,7 @@ void check_update_fw(void) {
|
|||
break;
|
||||
case UPDATE_FW_ERROR_MICRO_FLASH_MANGLED:
|
||||
// We've broken our internal flash when trying to update our normal
|
||||
// firmware. Fall back immediately to the recovery firmare.
|
||||
// firmware. Fall back immediately to the recovery firmware.
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_ONE);
|
||||
boot_bit_set(BOOT_BIT_FW_START_FAIL_STRIKE_TWO);
|
||||
system_reset();
|
||||
|
|
|
@ -162,14 +162,14 @@ SECTIONS
|
|||
It is one task of the startup to copy the initial values from FLASH to RAM. */
|
||||
.data : {
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
/* This is used by the startup in order to initialize the .data section */
|
||||
__data_start = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
__data_end = .; /* This is used by the startup in order to initialize the .data secion */
|
||||
__data_end = .; /* This is used by the startup in order to initialize the .data section */
|
||||
} >RAM AT>FLASH
|
||||
__data_load_start = LOADADDR(.data);
|
||||
|
||||
|
@ -177,14 +177,14 @@ SECTIONS
|
|||
.bss (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
__bss_start = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_end = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
__bss_end = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
} >RAM
|
||||
|
||||
.stack (NOLOAD) :
|
||||
|
|
|
@ -41,7 +41,7 @@ void NOINLINE delay_us(uint32_t us) {
|
|||
|
||||
void delay_ms(uint32_t millis) {
|
||||
// delay_us(millis*1000) is not used because a long delay could easily
|
||||
// overflow the veriable. Without the outer loop, a delay of even five
|
||||
// overflow the variable. Without the outer loop, a delay of even five
|
||||
// seconds would overflow.
|
||||
while (millis--) {
|
||||
delay_us(1000);
|
||||
|
|
|
@ -85,7 +85,7 @@ def process_binary_header(self):
|
|||
file is treated as a raw binary file.
|
||||
|
||||
The name of the array variable defaults to the source file name with all
|
||||
characters that are invaid C identifiers replaced with underscores. The name
|
||||
characters that are invalid C identifiers replaced with underscores. The name
|
||||
can be explicitly specified by setting the *array_name* parameter.
|
||||
|
||||
This method overrides the processing by
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
"""
|
||||
Support for converting linked targets to ihex, srec or binary files using
|
||||
objcopy. Use the 'objcopy' feature in conjuction with the 'cc' or 'cxx'
|
||||
objcopy. Use the 'objcopy' feature in conjunction with the 'cc' or 'cxx'
|
||||
feature. The 'objcopy' feature uses the following attributes:
|
||||
|
||||
objcopy_bfdname Target object format name (eg. ihex, srec, binary).
|
||||
|
|
|
@ -59,28 +59,28 @@ SECTIONS
|
|||
It is one task of the startup to copy the initial values from FLASH to RAM. */
|
||||
.data : {
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
/* This is used by the startup in order to initialize the .data section */
|
||||
__data_start = .;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
|
||||
. = ALIGN(4);
|
||||
__data_end = .; /* This is used by the startup in order to initialize the .data secion */
|
||||
__data_end = .; /* This is used by the startup in order to initialize the .data section */
|
||||
} >RAM
|
||||
__data_load_start = LOADADDR(.data);
|
||||
|
||||
/* This is the uninitialized data section */
|
||||
.bss (NOLOAD) : {
|
||||
. = ALIGN(4);
|
||||
__bss_start = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
__bss_start = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
__bss_end = .; /* This is used by the startup in order to initialize the .bss secion */
|
||||
__bss_end = .; /* This is used by the startup in order to initialize the .bss section */
|
||||
} >RAM
|
||||
|
||||
.stack (NOLOAD) : {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
"""
|
||||
Support for converting linked targets to ihex, srec or binary files using
|
||||
objcopy. Use the 'objcopy' feature in conjuction with the 'cc' or 'cxx'
|
||||
objcopy. Use the 'objcopy' feature in conjunction with the 'cc' or 'cxx'
|
||||
feature. The 'objcopy' feature uses the following attributes:
|
||||
|
||||
objcopy_bfdname Target object format name (eg. ihex, srec, binary).
|
||||
|
|
|
@ -30,7 +30,7 @@ class FTDISerialWireDebug(object):
|
|||
self._ftdi = None
|
||||
raise
|
||||
|
||||
# get the FTDI FIFO size and increase the chuncksize to match
|
||||
# get the FTDI FIFO size and increase the chunksize to match
|
||||
self._ftdi_fifo_size = min(self._ftdi.fifo_sizes)
|
||||
self._ftdi.write_data_set_chunksize(self._ftdi_fifo_size)
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ from ..util 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'),
|
||||
|
@ -72,7 +72,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_bin(self, path):
|
||||
|
@ -83,7 +83,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}
|
||||
|
||||
|
|
|
@ -50,7 +50,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
|
||||
|
@ -113,7 +113,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
|
||||
|
|
|
@ -92,7 +92,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:
|
||||
|
@ -151,7 +151,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)
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ def dehash_str(hashed_info, lookup_dict):
|
|||
if formatted_string == hashed_info:
|
||||
formatted_string = lookup_dict.get(str(int(match.group('hash_key'), 16)), hashed_info)
|
||||
|
||||
# For each argument, substitute a C-style format specififier in the string
|
||||
# For each argument, substitute a C-style format specifier in the string
|
||||
for arg in parse_args(match.group('arg_list')):
|
||||
formatted_string = FORMAT_TAG_PATTERN.sub(arg, formatted_string, 1)
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ def test_parse_args():
|
|||
"""
|
||||
Test for parse_args()
|
||||
"""
|
||||
# No `` delimted strings
|
||||
# No `` delimited strings
|
||||
assert ["foo", "bar", "baz"] == parse_args("foo bar baz")
|
||||
|
||||
# `` delimited strings
|
||||
|
|
|
@ -114,7 +114,7 @@ class Interface(object):
|
|||
return socket
|
||||
|
||||
def unregister_socket(self, protocol):
|
||||
'''Used by InterfaceSocket objets to unregister themselves when
|
||||
'''Used by InterfaceSocket objects to unregister themselves when
|
||||
closing.
|
||||
'''
|
||||
try:
|
||||
|
|
|
@ -11,4 +11,4 @@ This archive contains v1.3 firmware for the Pebble E-Paper Watch.
|
|||
- 2v5 I2C driver bugfixes.
|
||||
- iPhone ACP stability improvements.
|
||||
- Text rendering performance improvements.
|
||||
- Support for entering shippiing-mode (standby) via a Bluetooth command.
|
||||
- Support for entering shipping-mode (standby) via a Bluetooth command.
|
||||
|
|
|
@ -30,7 +30,7 @@ This archive contains the EV2-4 software for the Pebble E-Paper Watch.
|
|||
included in the directory. For more information, please refer to
|
||||
the 'Flash imaging tools' section.
|
||||
- docs/spi_flash_imaging.txt: A document describing the protocol
|
||||
used to load load data onto Pebble's SPI flash via
|
||||
used to load data onto Pebble's SPI flash via
|
||||
the Serial UART
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ What's New
|
|||
* Improved Notification UI
|
||||
- Allows multiple notifications to be viewed if they arrive within a short time frame
|
||||
* Improved Set Time UI
|
||||
* Added the option of showing your current speed (as oppossed to your pace) in the RunKeeper application.
|
||||
* Added the option of showing your current speed (as opposed to your pace) in the RunKeeper application.
|
||||
* Swapped next and previous track buttons in the music application.
|
||||
* Added the Simplicity watchface.
|
||||
* Removed the Fuzzy Time watchface (it is available through the watchapp library).
|
||||
|
|
|
@ -17,7 +17,7 @@ device is started.
|
|||
|
||||
Once the firmware has loaded, a new screen will appear with a small
|
||||
picture of a watch and the text "Please Connect to Phone". Please note
|
||||
that the watch will not respond respond to button inputs while this
|
||||
that the watch will not respond to button inputs while this
|
||||
screen is being displayed.
|
||||
|
||||
Please contact ajw@getpebble.com with any questions.
|
||||
|
|
|
@ -76,7 +76,7 @@ echo "${README_TEXT}" > ${OUT_DIR}/README.txt
|
|||
# Create the requirements.txt file
|
||||
echo "${REQUIREMENTS_TEXT}" > ${OUT_DIR}/requirements.txt
|
||||
|
||||
# Copy the scripts we're interested into the ouput directory
|
||||
# Copy the scripts we're interested into the output directory
|
||||
mkdir -p ${OUT_DIR}/scripts
|
||||
cp tools/hdlc.py ${OUT_DIR}/scripts/
|
||||
cp tools/binutils.py ${OUT_DIR}/scripts/
|
||||
|
|
|
@ -79,7 +79,7 @@ echo "${README_TEXT}" > ${OUT_DIR}/README.txt
|
|||
# Create the requirements.txt file
|
||||
echo "${REQUIREMENTS_TEXT}" > ${OUT_DIR}/requirements.txt
|
||||
|
||||
# Copy the scripts we're interested into the ouput directory
|
||||
# Copy the scripts we're interested into the output directory
|
||||
mkdir -p ${OUT_DIR}/scripts
|
||||
cp tools/hdlc.py ${OUT_DIR}/scripts/
|
||||
cp tools/binutils.py ${OUT_DIR}/scripts/
|
||||
|
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
@ -1041,7 +1041,7 @@
|
|||
{
|
||||
"type": "pdc",
|
||||
"name": "DAY_SEPARATOR_SMALL",
|
||||
"file": "normal/base/images/Pebble_50x50_Day_seperator.svg"
|
||||
"file": "normal/base/images/Pebble_50x50_Day_separator.svg"
|
||||
},
|
||||
{
|
||||
"type": "pdc",
|
||||
|
|
|
@ -351,7 +351,7 @@
|
|||
if (this._getNextMessageType() !== "object") {
|
||||
// This is no longer our highest priority outgoing message.
|
||||
// Send that message instead, and this message will be left in the queue
|
||||
// andrestarted when appropriate.
|
||||
// and restarted when appropriate.
|
||||
this._resetCurrent();
|
||||
this._sendNext();
|
||||
return;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Template vars injected by projess_js.py:
|
||||
// Template vars injected by process_js.py:
|
||||
|
||||
// boolean
|
||||
const isSandbox = ${IS_SANDBOX};
|
||||
|
|
|
@ -296,7 +296,7 @@ def _get_entry_point(ctx, js_type, waf_js_entry_point):
|
|||
def pbl_bundle(self, *k, **kw):
|
||||
"""
|
||||
This method is bound to the build context and is called by specifying `bld.pbl_bundle`. We
|
||||
set the custome features `js` and `bundle` to run when this method is invoked.
|
||||
set the custom features `js` and `bundle` to run when this method is invoked.
|
||||
:param self: the BuildContext object
|
||||
:param k: none expected
|
||||
:param kw:
|
||||
|
|
|
@ -35,7 +35,7 @@ def _generate_sdk_waf(ctx):
|
|||
for tool in sdk_waftools + shared_waftools:
|
||||
path = ctx.path.parent.find_node(tool)
|
||||
if path is None:
|
||||
ctx.fatal("Trying to bundle non existent resource in pb-waf ({})".format(tool))
|
||||
ctx.fatal("Trying to bundle nonexistent resource in pb-waf ({})".format(tool))
|
||||
pebble_waf_tools.append(path)
|
||||
|
||||
# We cannot run this as a sub-wscript because we use a specific vendor-provided
|
||||
|
|
|
@ -169,7 +169,7 @@ void handle_init(void) {
|
|||
|
||||
text_layer_set_text(text_layer, "? ? ?");
|
||||
|
||||
// Subscribe to mesages published by the worker
|
||||
// Subscribe to messages published by the worker
|
||||
app_worker_message_subscribe(steps_event_handler);
|
||||
|
||||
// Subscribe to second ticks
|
||||
|
|
|
@ -367,7 +367,7 @@ static void window_load(Window *window) {
|
|||
|
||||
layer_add_child(window_layer, menu_layer_get_layer(s_menu_layer));
|
||||
|
||||
// Start scanning. Advertisments will be delivered in the callback.
|
||||
// Start scanning. Advertisements will be delivered in the callback.
|
||||
toggle_scan();
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ static Animation *prv_create_custom_animation(void) {
|
|||
|
||||
|
||||
static void click_handler(ClickRecognizerRef recognizer, Window *window) {
|
||||
// If the animation is still running, fast-foward to 300ms from the end
|
||||
// If the animation is still running, fast-forward to 300ms from the end
|
||||
if (animation_is_scheduled(s_animation)) {
|
||||
uint32_t duration = animation_get_duration(s_animation, true, true);
|
||||
animation_set_elapsed(s_animation, duration - 300);
|
||||
|
@ -142,7 +142,7 @@ static void click_handler(ClickRecognizerRef recognizer, Window *window) {
|
|||
}
|
||||
|
||||
/*
|
||||
// Exmple animation parameters:
|
||||
// Example animation parameters:
|
||||
|
||||
// Duration defaults to 250 ms
|
||||
animation_set_duration(&prop_animation->animation, 1000);
|
||||
|
|
|
@ -179,7 +179,7 @@ static void prv_window_load(Window *window) {
|
|||
// one image at the top left .topleft_layer,
|
||||
// and two menu layers .action_list1 and .action_list2 that overlay each other
|
||||
|
||||
// some hackery with the two menu layers goes on to keep their scroll offest in sync
|
||||
// some hackery with the two menu layers goes on to keep their scroll offset in sync
|
||||
// and to have the inverter layer rendered only once
|
||||
|
||||
const int16_t navbar_width = s_fps_topleft_bitmap.bounds.size.w;
|
||||
|
|
|
@ -1033,7 +1033,7 @@ static void prv_debug_cmd_heart_rate_api(int index, void *context) {
|
|||
goto exit;
|
||||
}
|
||||
|
||||
// Test registring and cancelling a metric alert
|
||||
// Test registering and cancelling a metric alert
|
||||
HealthMetricAlert *alert = health_service_register_metric_alert(HealthMetricHeartRateBPM, 10);
|
||||
APP_LOG(APP_LOG_LEVEL_DEBUG, "Result from register_metric_alert: %p", alert);
|
||||
if (alert == NULL) {
|
||||
|
|
|
@ -204,7 +204,7 @@ AppMessageResult app_message_open(const uint32_t size_inbound, const uint32_t si
|
|||
void app_message_close(void) {
|
||||
AppMessageCtx *app_message_ctx = app_state_get_app_message_ctx();
|
||||
|
||||
// TODO PBL-1634: handle the the return status when this function returns status.
|
||||
// TODO PBL-1634: handle the return status when this function returns status.
|
||||
// For now, continue to ignore failure.
|
||||
app_message_outbox_close(&app_message_ctx->outbox);
|
||||
app_message_inbox_close(&app_message_ctx->inbox);
|
||||
|
|
|
@ -344,7 +344,7 @@ void app_message_deregister_callbacks(void);
|
|||
|
||||
// -------- AppMessage Lifecycle ----------------------------------------------------------------------------------- //
|
||||
|
||||
//! Programatically determine the inbox size maximum in the current configuration.
|
||||
//! Programmatically determine the inbox size maximum in the current configuration.
|
||||
//!
|
||||
//! \return The inbox size maximum on this firmware.
|
||||
//!
|
||||
|
@ -353,7 +353,7 @@ void app_message_deregister_callbacks(void);
|
|||
//!
|
||||
uint32_t app_message_inbox_size_maximum(void);
|
||||
|
||||
//! Programatically determine the outbox size maximum in the current configuration.
|
||||
//! Programmatically determine the outbox size maximum in the current configuration.
|
||||
//!
|
||||
//! \return The outbox size maximum on this firmware.
|
||||
//!
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
//! Error values which may be returned from the smartstrap APIs.
|
||||
typedef enum {
|
||||
//! No error occured.
|
||||
//! No error occurred.
|
||||
SmartstrapResultOk = 0,
|
||||
//! Invalid function arguments were supplied.
|
||||
SmartstrapResultInvalidArgs,
|
||||
|
@ -69,7 +69,7 @@ typedef enum {
|
|||
SmartstrapResultServiceUnavailable,
|
||||
//! The smartstrap reported that it does not support the requested attribute.
|
||||
SmartstrapResultAttributeUnsupported,
|
||||
//! A time-out occured during the request.
|
||||
//! A time-out occurred during the request.
|
||||
SmartstrapResultTimeOut,
|
||||
} SmartstrapResult;
|
||||
|
||||
|
@ -153,7 +153,7 @@ void app_smartstrap_set_timeout(uint16_t timeout_ms);
|
|||
//! @param attribute_id The AttributeId to create the attribute for.
|
||||
//! @param buffer_length The length of the internal buffer which will be used to store the read
|
||||
//! and write requests for this attribute.
|
||||
//! @returns The newly created SmartstrapAttribute or NULL if an internal error occured or if the
|
||||
//! @returns The newly created SmartstrapAttribute or NULL if an internal error occurred or if the
|
||||
//! specified length is greater than SMARTSTRAP_ATTRIBUTE_LENGTH_MAXIMUM.
|
||||
SmartstrapAttribute *app_smartstrap_attribute_create(SmartstrapServiceId service_id,
|
||||
SmartstrapAttributeId attribute_id,
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
//! @file fw/applib/app_timer.c
|
||||
//!
|
||||
//! Surpise! All this is is a dumb wrapper around evented_timer!
|
||||
//! Surprise! All this is is a dumb wrapper around evented_timer!
|
||||
|
||||
DEFINE_SYSCALL(AppTimer*, app_timer_register, uint32_t timeout_ms,
|
||||
AppTimerCallback callback,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"",
|
||||
"Types are defined below with the following parameters: ",
|
||||
" name: The name of the type as it appears in our codebase. This type definition must ",
|
||||
" be visibile in one of the headers in the headers list below. ",
|
||||
" be visible in one of the headers in the headers list below. ",
|
||||
" size_2x: The size in bytes that should be used for legacy2 apps ",
|
||||
" size_3x: The size in bytes that should be used for 3.x apps ",
|
||||
" size_3x_padding: The amount of padding to add directly to this particular struct. ",
|
||||
|
|
|
@ -42,7 +42,7 @@ bool applib_resource_munmap_all();
|
|||
//! or for a given resource if will try to allocate data and load it into RAM instead.
|
||||
//! Have a look at \ref resource_load_byte_range_system for the discussion of arguments
|
||||
//! @param used_aligned True, if you want this function to allocate 7 extra bytes if it cannot mmap
|
||||
//! @return NULL, if the resource coudln't be memory-mapped or allocated
|
||||
//! @return NULL, if the resource couldn't be memory-mapped or allocated
|
||||
void *applib_resource_mmap_or_load(ResAppNum app_num, uint32_t resource_id,
|
||||
size_t offset, size_t length, bool used_aligned);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <bluetooth/bluetooth_types.h>
|
||||
|
||||
//! @file ble_ad_parse.h
|
||||
//! API to serialize and deserialize advertisment and scan response payloads.
|
||||
//! API to serialize and deserialize advertisement and scan response payloads.
|
||||
//!
|
||||
//! Inbound payloads, as received using the ble_scan.h public API, can be
|
||||
//! consumed/deserialized using the functions below.
|
||||
|
@ -81,7 +81,7 @@ bool ble_ad_get_tx_power_level(const BLEAdData *ad, int8_t *tx_power_level_out);
|
|||
size_t ble_ad_copy_local_name(const BLEAdData *ad,
|
||||
char *buffer, size_t size);
|
||||
|
||||
//! If the Local Name is present in the advertisment data, returns the number
|
||||
//! If the Local Name is present in the advertisement data, returns the number
|
||||
//! of bytes a C-string needs to be to hold the full name.
|
||||
//! @param ad The advertisement data
|
||||
//! @return The size of the Local Name in bytes, *including* zero terminator.
|
||||
|
@ -108,7 +108,7 @@ size_t ble_ad_copy_manufacturer_specific_data(const BLEAdData *ad,
|
|||
uint16_t *company_id_out,
|
||||
uint8_t *buffer, size_t size);
|
||||
|
||||
//! Gets the size in bytes of Manufacturer Specific data in the advertisment.
|
||||
//! Gets the size in bytes of Manufacturer Specific data in the advertisement.
|
||||
//! @param ad The advertisement data
|
||||
//! @return The size of the data, in bytes. If the Manufacturer Specific data is
|
||||
//! not present, zero is returned.
|
||||
|
|
|
@ -184,7 +184,7 @@ uint16_t ble_client_get_maximum_value_length(BTDevice device);
|
|||
//! @return BTErrnoOK if the operation was successfully started, or ... TODO
|
||||
BTErrno ble_client_read(BLECharacteristic characteristic);
|
||||
|
||||
//! Write the value of a characterstic.
|
||||
//! Write the value of a characteristic.
|
||||
//! A call to this function will result in a callback to the registered
|
||||
//! BLEClientWriteHandler handler. @see ble_client_set_write_response_handler.
|
||||
//! @param characteristic The characteristic for which to write the value
|
||||
|
@ -196,7 +196,7 @@ BTErrno ble_client_write(BLECharacteristic characteristic,
|
|||
const uint8_t *value,
|
||||
size_t value_length);
|
||||
|
||||
//! Write the value of a characterstic without response.
|
||||
//! Write the value of a characteristic without response.
|
||||
//! @param characteristic The characteristic for which to write the value
|
||||
//! @param value Buffer with the value to write
|
||||
//! @param value_length Number of bytes to write
|
||||
|
@ -234,7 +234,7 @@ BTErrno ble_client_write_without_response(BLECharacteristic characteristic,
|
|||
//! @note Under the hood, this API writes to the Client Characteristic
|
||||
//! Configuration Descriptor's Notifications or Indications enabled/disabled
|
||||
//! bit.
|
||||
//! @return BTErrnoOK if the subscription request was sent sucessfully, or
|
||||
//! @return BTErrnoOK if the subscription request was sent successfully, or
|
||||
//! TODO...
|
||||
BTErrno ble_client_subscribe(BLECharacteristic characteristic,
|
||||
BLESubscription subscription_type);
|
||||
|
|
|
@ -45,7 +45,7 @@ typedef struct {
|
|||
|
||||
//! The calibrated power of the iBeacon. This is the RSSI measured at 1 meter
|
||||
//! distance from the iBeacon. The iBeacon transmits this information in its
|
||||
//! advertisment. Using this and the actual RSSI, the distance is estimated.
|
||||
//! advertisement. Using this and the actual RSSI, the distance is estimated.
|
||||
int8_t calibrated_tx_power;
|
||||
} BLEiBeacon;
|
||||
|
||||
|
@ -90,7 +90,7 @@ void ble_ibeacon_destroy(BLEiBeacon *ibeacon);
|
|||
//! @param rssi The RSSI of the advertisement
|
||||
//! @param[out] ibeacon_out Will contain the parsed iBeacon data if the call
|
||||
//! returns true.
|
||||
//! @return true if the data element was succesfully parsed as iBeacon,
|
||||
//! @return true if the data element was successfully parsed as iBeacon,
|
||||
//! false if the data element could not be parsed as iBeacon.
|
||||
bool ble_ibeacon_parse(const BLEAdData *ad, int8_t rssi,
|
||||
BLEiBeacon *ibeacon_out);
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
#include <bluetooth/bluetooth_types.h>
|
||||
|
||||
//! Callback that is called for each advertisment that is found while scanning
|
||||
//! Callback that is called for each advertisement that is found while scanning
|
||||
//! using ble_scan_start().
|
||||
//! @param device The device from which the advertisment originated.
|
||||
//! @param device The device from which the advertisement originated.
|
||||
//! @param rssi The RSSI (Received Signal Strength Indication) of the
|
||||
//! advertisement.
|
||||
//! @param advertisement_data The payload of the advertisement. When there was
|
||||
|
@ -38,7 +38,7 @@ typedef void (*BLEScanHandler)(BTDevice device,
|
|||
|
||||
//! Start scanning for advertisements. Pebble will scan actively, meaning it
|
||||
//! will perform scan requests whenever the advertisement is scannable.
|
||||
//! @param handler The callback to handle the found advertisments. It must not
|
||||
//! @param handler The callback to handle the found advertisements. It must not
|
||||
//! be NULL.
|
||||
//! @return BTErrnoOK if scanning started successfully, BTErrnoInvalidParameter
|
||||
//! if the handler was invalid or BTErrnoInvalidState if scanning had already
|
||||
|
|
|
@ -39,7 +39,7 @@ uint8_t ble_service_get_characteristics(BLEService service,
|
|||
//! @return The 128-bit Service UUID, or UUID_INVALID if the service reference
|
||||
//! was invalid.
|
||||
//! @note The returned UUID is always a 128-bit UUID, even if the device
|
||||
//! its interal GATT service database uses 16-bit or 32-bit Service UUIDs.
|
||||
//! its internal GATT service database uses 16-bit or 32-bit Service UUIDs.
|
||||
//! @see bt_uuid_expand_16bit for a macro that converts 16-bit UUIDs to 128-bit
|
||||
//! equivalents.
|
||||
//! @see bt_uuid_expand_32bit for a macro that converts 32-bit UUIDs to 128-bit
|
||||
|
|
|
@ -125,10 +125,10 @@ void data_logging_finish(DataLoggingSessionRef logging_session);
|
|||
//! DATA_LOGGING_NOT_FOUND if the logging session is invalid
|
||||
//!
|
||||
//! @return
|
||||
//! DATA_LOGGING_CLOSED if the sesion is not active
|
||||
//! DATA_LOGGING_CLOSED if the session is not active
|
||||
//!
|
||||
//! @return
|
||||
//! DATA_LOGGING_BUSY if the sesion is not available for writing
|
||||
//! DATA_LOGGING_BUSY if the session is not available for writing
|
||||
//!
|
||||
//! @return
|
||||
//! DATA_LOGGING_INVALID_PARAMS if num_items is 0 or data is NULL
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
|
||||
//! @file framebuffer.c
|
||||
//! Bitdepth independant routines for framebuffer.h
|
||||
//! Bitdepth depenedant routines can be found in the 1_bit & 8_bit folders in their
|
||||
//! Bitdepth independent routines for framebuffer.h
|
||||
//! Bitdepth dependent routines can be found in the 1_bit & 8_bit folders in their
|
||||
//! respective framebuffer.c files.
|
||||
|
||||
#include "applib/graphics/framebuffer.h"
|
||||
|
|
|
@ -145,7 +145,7 @@ void gbitmap_init_with_data(GBitmap *bitmap, const uint8_t *data) {
|
|||
bitmap->info.is_bitmap_heap_allocated = false;
|
||||
|
||||
// Note that our container contains values for the origin, but we want to ignore them.
|
||||
// This is because orginally we just serialized GBitmap to disk,
|
||||
// This is because originally we just serialized GBitmap to disk,
|
||||
// but these fields don't really make sense for static images.
|
||||
// These origin fields are only used when reusing a byte buffer in a sub bitmap.
|
||||
// This allows us to have a shallow copy of a portion of a parent bitmap.
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
//! (width by height) and the first bit of image data is the pixel at (0, 0),
|
||||
//! then the bounds.size would be `GSize(29, 5)` and bounds.origin would be `GPoint(0, 0)`.
|
||||
//! 
|
||||
//! In the illustration each pixel is a representated as a square. The white
|
||||
//! In the illustration each pixel is a represented as a square. The white
|
||||
//! squares are the bits that are used, the gray squares are the padding bits, because
|
||||
//! each row of image data has to be a multiple of 4 bytes (32 bits).
|
||||
//! The numbers in the column in the left are the offsets (in bytes) from the `*addr`
|
||||
|
@ -54,7 +54,7 @@
|
|||
//! 
|
||||
//!
|
||||
//! - \ref GBitmapFormat8Bit:
|
||||
//! Each pixel in the bitmap is represented by 1 byte. The color value of that byte correspends to
|
||||
//! Each pixel in the bitmap is represented by 1 byte. The color value of that byte corresponds to
|
||||
//! a GColor.argb value.
|
||||
//! There is no restriction on row_size_bytes / stride.
|
||||
//!
|
||||
|
|
|
@ -288,7 +288,7 @@ bool gbitmap_sequence_update_bitmap_next_frame(GBitmapSequence *bitmap_sequence,
|
|||
const bool bitmap_supports_transparency = (bitmap_format != GBitmapFormat1Bit);
|
||||
|
||||
// DISPOSE_OP_BACKGROUND sets the background to black with transparency (0x00)
|
||||
// If we don't support tranparency, just do nothing.
|
||||
// If we don't support transparency, just do nothing.
|
||||
if (bitmap_supports_transparency &&
|
||||
(png_decoder_data->last_dispose_op == APNG_DISPOSE_OP_BACKGROUND)) {
|
||||
const uint32_t y_origin = bitmap->bounds.origin.y + png_decoder_data->previous_yoffset;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "gtypes.h"
|
||||
|
||||
//! This is used for performaing backward-compatibility conversions with 1-bit GColors.
|
||||
//! This is used for performing backward-compatibility conversions with 1-bit GColors.
|
||||
GColor8 get_native_color(GColor2 color) {
|
||||
switch (color) {
|
||||
case GColor2Black:
|
||||
|
|
|
@ -71,7 +71,7 @@ typedef enum {
|
|||
typedef struct {
|
||||
//! Describes how to treat the range between .min_x and .max_x
|
||||
GDrawMaskRowInfoType type;
|
||||
//! Left-most pixel, 3.0 means that that pixel 3 is fully visible, 3.5 means it's half visible
|
||||
//! Left-most pixel, 3.0 means that pixel 3 is fully visible, 3.5 means it's half visible
|
||||
Fixed_S16_3 min_x;
|
||||
//! Right-most pixel, 10.7 means that pixel 10 is fully opaque
|
||||
Fixed_S16_3 max_x;
|
||||
|
@ -230,8 +230,8 @@ void graphics_context_mask_destroy(GContext *ctx, GDrawMask *mask);
|
|||
GSize graphics_context_get_framebuffer_size(GContext *ctx);
|
||||
|
||||
//! @internal
|
||||
//! Retreives the destination bitmap for the graphics context.
|
||||
//! @param ctx The graphics context to retreive the bitmap for.
|
||||
//! Retrieves the destination bitmap for the graphics context.
|
||||
//! @param ctx The graphics context to retrieve the bitmap for.
|
||||
GBitmap* graphics_context_get_bitmap(GContext* ctx);
|
||||
|
||||
//! @internal
|
||||
|
|
|
@ -74,7 +74,7 @@ bool gdraw_command_image_validate(GDrawCommandImage *image, size_t size);
|
|||
//! @param offset Offset from draw context origin to draw the image
|
||||
void gdraw_command_image_draw(GContext *ctx, GDrawCommandImage *image, GPoint offset);
|
||||
|
||||
//! Draw an image after being processed by the passed in proccessor
|
||||
//! Draw an image after being processed by the passed in processor
|
||||
//! @param ctx The destination graphics context in which to draw
|
||||
//! @param image Image to draw
|
||||
//! @param offset Offset from draw context origin to draw the image
|
||||
|
|
|
@ -40,7 +40,7 @@ typedef struct GDrawCommandProcessor GDrawCommandProcessor;
|
|||
|
||||
//! Callback for iterating over GDrawCommands
|
||||
//! @param processor GDrawCommandProcessor that is currently iterating over the GDrawCommandList.
|
||||
//! @param proccessed_command Copy of the current GDrawCommand that can be modified
|
||||
//! @param processed_command Copy of the current GDrawCommand that can be modified
|
||||
//! @param processed_command_max_size Size of GDrawCommand being processed
|
||||
//! @param list list of GDrawCommands that will be modified by the processor
|
||||
//! @param command Current GDrawCommand being processed
|
||||
|
@ -123,7 +123,7 @@ size_t gdraw_command_list_get_data_size(GDrawCommandList *command_list);
|
|||
//! The order is guaranteed to be the definition order of the points
|
||||
//! @param command_list \ref GDrawCommandList from which to collect points
|
||||
//! @param is_precise true to convert to GPointPrecise, otherwise points are converted to GPoint
|
||||
//! @param num_points_out Optinal pointer to uint16_t to receive the num points
|
||||
//! @param num_points_out Optional pointer to uint16_t to receive the num points
|
||||
GPoint *gdraw_command_list_collect_points(GDrawCommandList *command_list, bool is_precise,
|
||||
uint16_t *num_points_out);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void gpath_init(GPath *path, const GPathInfo *init) {
|
|||
|
||||
GPath* gpath_create(const GPathInfo *init) {
|
||||
// Can't pad this out because the definition itself is exported. Even if we did pad it out so
|
||||
// we can theoretically add members to the end of the struct, we'll still have to add compatibilty
|
||||
// we can theoretically add members to the end of the struct, we'll still have to add compatibility
|
||||
// flags throughout here to check which size of struct the app is going to pass us through these
|
||||
// APIs.
|
||||
GPath* path = applib_malloc(sizeof(GPath));
|
||||
|
|
|
@ -239,7 +239,7 @@ void graphics_fill_round_rect(GContext* ctx, const GRect *rect, uint16_t radius,
|
|||
|
||||
#if PBL_COLOR
|
||||
if (ctx->draw_state.antialiased) {
|
||||
// Antialiased (not suppported on 1-bit color)
|
||||
// Antialiased (not supported on 1-bit color)
|
||||
prv_fill_rect_aa(ctx, rect, radius, corner_mask, ctx->draw_state.fill_color);
|
||||
return;
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ void graphics_draw_round_rect(GContext* ctx, const GRect *rect, uint16_t radius)
|
|||
prv_draw_round_rect_aa_stroked(ctx, rect, radius, ctx->draw_state.stroke_width);
|
||||
return;
|
||||
} else {
|
||||
// Antialiased and Stroke Width == 1 (not suppported on 1-bit color)
|
||||
// Antialiased and Stroke Width == 1 (not supported on 1-bit color)
|
||||
// Note: stroke width == 2 is rounded down to stroke width of 1
|
||||
prv_draw_round_rect_aa(ctx, rect, radius);
|
||||
return;
|
||||
|
|
|
@ -127,13 +127,13 @@ T_STATIC GColor get_bitmap_color(GBitmap *bmp, int x, int y) {
|
|||
0, // y = 0 when using data_row
|
||||
bmp->row_size_bytes,
|
||||
src_bpp);
|
||||
// Default color to be the raw color index - update only if palletized
|
||||
// Default color to be the raw color index - update only if palettized
|
||||
GColor src_color = (GColor){.argb = cindex};
|
||||
bool palletized = ((format == GBitmapFormat1BitPalette) ||
|
||||
bool palettized = ((format == GBitmapFormat1BitPalette) ||
|
||||
(format == GBitmapFormat2BitPalette) ||
|
||||
(format == GBitmapFormat4BitPalette));
|
||||
if (palletized) {
|
||||
// Look up color in pallete if palletized
|
||||
if (palettized) {
|
||||
// Look up color in palette if palettized
|
||||
const GColor *palette = bmp->palette;
|
||||
src_color = palette[cindex];
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ void graphics_draw_rotated_bitmap(GContext* ctx, GBitmap *src, GPoint src_ic, in
|
|||
background = GColorWhite;
|
||||
break;
|
||||
default:
|
||||
PBL_ASSERT(0, "unknown coposting mode %d", compositing_mode);
|
||||
PBL_ASSERT(0, "unknown compositing mode %d", compositing_mode);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -215,7 +215,7 @@ void graphics_draw_rotated_bitmap(GContext* ctx, GBitmap *src, GPoint src_ic, in
|
|||
const int32_t width = 2 * (max_width + 1); // Add one more pixel in case on the edge
|
||||
const int32_t height = 2 * (max_height + 1); // Add one more pixel in case on the edge
|
||||
|
||||
// add two pixels just in case of rounding isssues
|
||||
// add two pixels just in case of rounding issues
|
||||
const int32_t max_distance = integer_sqrt((width * width) + (height * height)) + 2;
|
||||
const int32_t min_x = src_ic.x - max_distance;
|
||||
const int32_t min_y = src_ic.y - max_distance;
|
||||
|
|
|
@ -80,7 +80,7 @@ static GPointPrecise prv_get_rotated_precise_point_for_ellipsis(GPointPrecise ce
|
|||
}
|
||||
}
|
||||
|
||||
// This algorthm operates on angle starting at our 90° mark, so we add 90°
|
||||
// This algorithm operates on angle starting at our 90° mark, so we add 90°
|
||||
// and flip x/y coordinates (see last line of this function)
|
||||
angle = (angle + (TRIG_MAX_ANGLE / 4)) % TRIG_MAX_ANGLE;
|
||||
|
||||
|
@ -179,7 +179,7 @@ static void prv_plot4(GBitmap *fb, GRect *clip_box, GPoint center, GPoint offset
|
|||
* |
|
||||
*
|
||||
* + center point
|
||||
* - x coordiante mirror line
|
||||
* - x coordinate mirror line
|
||||
* | y coordinate mirror line
|
||||
* x given offset point
|
||||
* xn mirrored points
|
||||
|
@ -209,7 +209,7 @@ static void prv_plot8(GBitmap *fb, GRect *clip_box, GPoint center, GPoint offset
|
|||
* / x5| x4 \
|
||||
*
|
||||
* + center point
|
||||
* - x coordiante mirror line
|
||||
* - x coordinate mirror line
|
||||
* | y coordinate mirror line
|
||||
* / 45 degree mirror line
|
||||
* \ 135 degree mirror line
|
||||
|
@ -228,7 +228,7 @@ T_STATIC void graphics_circle_quadrant_draw_1px_aa(GContext* ctx, GPoint p, uint
|
|||
GCornerMask quadrant) {
|
||||
/* This will draw antialiased circle with width of 1px, can be drawn in quadrants
|
||||
* Based on wu-xiang line drawing, will draw circle in two steps
|
||||
* 1. Calculate point on the edge of eighth of the cricle and plot it around by mirroring
|
||||
* 1. Calculate point on the edge of eighth of the circle and plot it around by mirroring
|
||||
* - if point is matching pixel perfectly thats going to be on fully colored pixel
|
||||
* - if theres fraction, two pixels will be colored accordingly
|
||||
* 2. Fill special case pixels (pixels that are between mirrored eighths)
|
||||
|
@ -256,7 +256,7 @@ T_STATIC void graphics_circle_quadrant_draw_1px_aa(GContext* ctx, GPoint p, uint
|
|||
* x -
|
||||
*
|
||||
* | original calculated pixels for plotting
|
||||
* - mirrored eight of the circle (will mirror more of them if neccessary)
|
||||
* - mirrored eight of the circle (will mirror more of them if necessary)
|
||||
* o special case pixels
|
||||
* x center of the circle
|
||||
*/
|
||||
|
@ -303,7 +303,7 @@ T_STATIC void graphics_circle_quadrant_draw_1px_aa(GContext* ctx, GPoint p, uint
|
|||
// Note: magic numbers explained in main comment for this function
|
||||
int special_case_pixels = 3;
|
||||
|
||||
// Acommpanied by magic number 7 (not 6, we increased radius at beginning of this function)
|
||||
// Accompanied by magic number 7 (not 6, we increased radius at beginning of this function)
|
||||
if (radius < 7) {
|
||||
// And sometimes magic number 2
|
||||
special_case_pixels = 2;
|
||||
|
@ -379,7 +379,7 @@ inline void prv_hline_quadrant(GCornerMask quadrant, GCornerMask desired, GConte
|
|||
|
||||
static void prv_stroke_circle_quadrant_full(GContext* ctx, GPoint p, uint16_t radius,
|
||||
uint8_t stroke_width, GCornerMask quadrant) {
|
||||
// This algorithm will draw stroked circle with vairable width (only odd numbers for now)
|
||||
// This algorithm will draw stroked circle with variable width (only odd numbers for now)
|
||||
const uint8_t half_stroke_width = stroke_width / 2;
|
||||
const int16_t inner_radius = radius - half_stroke_width;
|
||||
const uint8_t outer_radius = radius + half_stroke_width;
|
||||
|
@ -459,7 +459,7 @@ void graphics_circle_quadrant_draw(GContext* ctx, GPoint p, uint16_t radius, GCo
|
|||
graphics_circle_quadrant_draw_stroked_aa(ctx, p, radius, stroke_width, quadrant);
|
||||
return;
|
||||
} else {
|
||||
// Antialiased and Stroke Width == 1 (not suppported on 1-bit color)
|
||||
// Antialiased and Stroke Width == 1 (not supported on 1-bit color)
|
||||
graphics_circle_quadrant_draw_1px_aa(ctx, p, radius, quadrant);
|
||||
return;
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ void graphics_draw_circle(GContext* ctx, GPoint p, uint16_t radius) {
|
|||
}
|
||||
|
||||
if (radius == 0) {
|
||||
// Special case radius 0 to fill a circle with radius eqaul to half the stroke width
|
||||
// Special case radius 0 to fill a circle with radius equal to half the stroke width
|
||||
// Backup the fill color and set that to the current stroke color since the fill color
|
||||
// is what is used for fill circle. Restore the fill color afterwards.
|
||||
GColor backup_fill_color = ctx->draw_state.fill_color;
|
||||
|
@ -835,7 +835,7 @@ static void prv_fill_oval_precise(GContext *ctx, GPointPrecise center,
|
|||
radius_inner_y.raw_value = MAX(radius_inner_y.raw_value, 0);
|
||||
|
||||
// This flag prevents from calculation of the inner circle (and bugs related to it)
|
||||
const bool no_innner_ellipsis = (radius_inner_x.raw_value == 0 || radius_inner_y.raw_value == 0);
|
||||
const bool no_inner_ellipsis = (radius_inner_x.raw_value == 0 || radius_inner_y.raw_value == 0);
|
||||
|
||||
// Squared radiuses values - they're used a lot in some cases
|
||||
const uint32_t radius_outer_x_sq =
|
||||
|
@ -857,16 +857,16 @@ static void prv_fill_oval_precise(GContext *ctx, GPointPrecise center,
|
|||
radius_outer_x.raw_value, radius_outer_y.raw_value,
|
||||
config.end_quadrant.angle);
|
||||
|
||||
GPointPrecise start_bottom = (no_innner_ellipsis) ? center :
|
||||
GPointPrecise start_bottom = (no_inner_ellipsis) ? center :
|
||||
prv_get_rotated_precise_point_for_ellipsis(center,
|
||||
radius_inner_x.raw_value, radius_inner_y.raw_value,
|
||||
config.start_quadrant.angle);
|
||||
GPointPrecise end_bottom = (no_innner_ellipsis) ? center :
|
||||
GPointPrecise end_bottom = (no_inner_ellipsis) ? center :
|
||||
prv_get_rotated_precise_point_for_ellipsis(center,
|
||||
radius_inner_x.raw_value, radius_inner_y.raw_value,
|
||||
config.end_quadrant.angle);
|
||||
|
||||
// Swapping top/bottom offset points if neccesary
|
||||
// Swapping top/bottom offset points if necessary
|
||||
if (start_top.y.raw_value > start_bottom.y.raw_value) {
|
||||
prv_swap_precise_points(&start_top, &start_bottom);
|
||||
} else if (start_top.y.raw_value == start_bottom.y.raw_value &&
|
||||
|
@ -883,15 +883,15 @@ static void prv_fill_oval_precise(GContext *ctx, GPointPrecise center,
|
|||
prv_swap_precise_points(&end_top, &end_bottom);
|
||||
}
|
||||
|
||||
// Range for scanline, since scanlines are mirred from the middle of the circle this is also
|
||||
// Range for scanline, since scanlines are mirrored from the middle of the circle this is also
|
||||
// indicated from the middle, therefore initialised with 0 (as middle) and
|
||||
// radius_y (as scalines are on y axis)
|
||||
// radius_y (as scanlines are on y axis)
|
||||
int draw_min = 0;
|
||||
int draw_max = radius_outer_y.integer;
|
||||
|
||||
// Adjust to drawing_box offset
|
||||
int adjusted_center = center.y.integer + ctx->draw_state.drawing_box.origin.y;
|
||||
// We add one to compenaste in case of odd line needs to be drawn
|
||||
// We add one to compensate in case of odd line needs to be drawn
|
||||
int adjusted_top = adjusted_center - radius_outer_y.integer - 1;
|
||||
int adjusted_bottom = adjusted_center + radius_outer_y.integer + 1;
|
||||
|
||||
|
@ -912,7 +912,7 @@ static void prv_fill_oval_precise(GContext *ctx, GPointPrecise center,
|
|||
int draw_max_top = MAX(center.y.integer - adjusted_top, 0);
|
||||
int draw_max_bottom = MAX(adjusted_bottom - center.y.integer, 0);
|
||||
int draw_min_top = MAX(center.y.integer - adjusted_bottom, 0);
|
||||
// In case of odd line, center is with half pixel so we have to subtract one more more full line
|
||||
// In case of odd line, center is with half pixel so we have to subtract one more full line
|
||||
int draw_min_bottom = MAX(adjusted_top - center.y.integer - 1, 0);
|
||||
|
||||
// Apply clipped distances
|
||||
|
@ -970,7 +970,7 @@ static void prv_fill_oval_precise(GContext *ctx, GPointPrecise center,
|
|||
int16_t left = center.x.raw_value - outer_edge;
|
||||
int16_t right = center.x.raw_value + outer_edge;
|
||||
|
||||
if (!no_innner_ellipsis && radius_inner_y.integer != 0) {
|
||||
if (!no_inner_ellipsis && radius_inner_y.integer != 0) {
|
||||
// This complicates the situation
|
||||
int16_t inner_edge =
|
||||
prv_get_ellipsis_border(y, radius_inner_y_sq, radius_inner_x_sq).raw_value;
|
||||
|
@ -1018,7 +1018,7 @@ static void prv_fill_oval_precise(GContext *ctx, GPointPrecise center,
|
|||
int16_t right = center.x.raw_value + outer_edge;
|
||||
|
||||
// If theres circle in the middle - calculate it:
|
||||
if (!no_innner_ellipsis && i < radius_inner_y.integer) {
|
||||
if (!no_inner_ellipsis && i < radius_inner_y.integer) {
|
||||
int16_t inner_edge =
|
||||
prv_get_ellipsis_border(y, radius_inner_y_sq, radius_inner_x_sq).raw_value;
|
||||
|
||||
|
@ -1211,7 +1211,7 @@ MOCKABLE void graphics_draw_arc_precise_internal(GContext *ctx, GPointPrecise ce
|
|||
center.x.raw_value -= center.x.raw_value % (FIXED_S16_3_ONE.raw_value / 2);
|
||||
center.y.raw_value -= center.y.raw_value % (FIXED_S16_3_ONE.raw_value / 2);
|
||||
|
||||
// To maintain compability we have to adjust from integral points where given point means
|
||||
// To maintain compatibility we have to adjust from integral points where given point means
|
||||
// center of the point
|
||||
center.x.raw_value += 4;
|
||||
center.y.raw_value += 4;
|
||||
|
|
|
@ -380,7 +380,7 @@ static bool prv_calc_far_points(GPointPrecise *p0, GPointPrecise *p1, Fixed_S16_
|
|||
}
|
||||
|
||||
// Since we already rotated the vector by 90 degrees, delta x is actually delta y
|
||||
// therefore if x is bigger than y we have have vertical dominance
|
||||
// therefore if x is bigger than y we have vertical dominance
|
||||
if (ABS(dx_fixed) > ABS(dy_fixed)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -411,13 +411,13 @@ void prv_draw_stroked_line_precise(GContext* ctx, GPointPrecise p0, GPointPrecis
|
|||
|
||||
ctx->draw_state.fill_color = ctx->draw_state.stroke_color;
|
||||
|
||||
// If so, draw a circle with corrseponding radius
|
||||
// If so, draw a circle with corresponding radius
|
||||
graphics_fill_circle(ctx, GPoint(p0.x.integer, p0.y.integer), radius.integer);
|
||||
|
||||
// Finish color hack
|
||||
ctx->draw_state.fill_color = temp_color;
|
||||
|
||||
// Return without drawing the line since its not neccessary
|
||||
// Return without drawing the line since its not necessary
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -459,7 +459,7 @@ void prv_draw_stroked_line_precise(GContext* ctx, GPointPrecise p0, GPointPrecis
|
|||
|
||||
// Drawing loop: Iterates over horizontal lines
|
||||
// As part of optimisation, this algorithm is moving between drawing boundaries,
|
||||
// so drawing box has to be substracted from its clipping extremes
|
||||
// so drawing box has to be subtracted from its clipping extremes
|
||||
const int16_t clip_min_y = ctx->draw_state.clip_box.origin.y
|
||||
- ctx->draw_state.drawing_box.origin.y;
|
||||
const int16_t clip_max_y = clip_min_y + ctx->draw_state.clip_box.size.h;
|
||||
|
@ -517,7 +517,7 @@ void prv_draw_stroked_line_precise(GContext* ctx, GPointPrecise p0, GPointPrecis
|
|||
Fixed_S16_3 left_margin = {.raw_value = INT16_MAX};
|
||||
Fixed_S16_3 right_margin = {.raw_value = INT16_MIN};
|
||||
|
||||
// Find edges of the line's straigth part
|
||||
// Find edges of the line's straight part
|
||||
if (y >= far_top.y.integer && y <= far_bottom.y.integer) {
|
||||
// TODO: possible performance optimization: PBL-14744
|
||||
// TODO: ^^ also possible avoid of following logic to avoid division by zero
|
||||
|
@ -585,7 +585,7 @@ void prv_draw_stroked_line_precise(GContext* ctx, GPointPrecise p0, GPointPrecis
|
|||
|
||||
// Drawing loop: Iterates over vertical lines from left to right
|
||||
// As part of optimisation, this algorithm is moving between drawing boundaries,
|
||||
// so drawing box has to be substracted from its clipping extremes
|
||||
// so drawing box has to be subtracted from its clipping extremes
|
||||
const int16_t clip_min_x = ctx->draw_state.clip_box.origin.x
|
||||
- ctx->draw_state.drawing_box.origin.x;
|
||||
const int16_t clip_max_x = clip_min_x + ctx->draw_state.clip_box.size.w;
|
||||
|
@ -645,7 +645,7 @@ void prv_draw_stroked_line_precise(GContext* ctx, GPointPrecise p0, GPointPrecis
|
|||
Fixed_S16_3 top_margin = {.raw_value = INT16_MAX};
|
||||
Fixed_S16_3 bottom_margin = {.raw_value = INT16_MIN};
|
||||
|
||||
// Find edges of the line's straigth part
|
||||
// Find edges of the line's straight part
|
||||
if (x >= far_left.x.integer && x <= far_right.x.integer) {
|
||||
// Main part of the stroked line
|
||||
if (tm_p1.x.raw_value != tm_p0.x.raw_value) {
|
||||
|
@ -774,7 +774,7 @@ void graphics_draw_line(GContext* ctx, GPoint p0, GPoint p1) {
|
|||
graphics_line_draw_stroked_aa(ctx, p0, p1, ctx->draw_state.stroke_width);
|
||||
return;
|
||||
} else {
|
||||
// Antialiased and Stroke Width == 1 (not suppported on 1-bit color)
|
||||
// Antialiased and Stroke Width == 1 (not supported on 1-bit color)
|
||||
graphics_line_draw_1px_aa(ctx, p0, p1);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ void graphics_private_draw_horizontal_line_prepared(GContext *ctx, GBitmap *fram
|
|||
|
||||
void graphics_private_draw_horizontal_line_integral(GContext *ctx, GBitmap *framebuffer, int16_t y,
|
||||
int16_t x1, int16_t x2, GColor color) {
|
||||
// This is a wrapper for prv_draw_horizontal_line_raw for integral coordintaes
|
||||
// This is a wrapper for prv_draw_horizontal_line_raw for integral coordinates
|
||||
|
||||
// End of the line is inclusive so we subtract one
|
||||
x2--;
|
||||
|
|
|
@ -188,7 +188,7 @@ T_STATIC void prv_assign_vertical_line_raw(GContext *ctx, int16_t x, Fixed_S16_3
|
|||
}
|
||||
|
||||
// This function draws horizontal line with blending, given values have to be clipped and adjusted
|
||||
// clip_box and draw_box respecively.
|
||||
// clip_box and draw_box respectively.
|
||||
T_STATIC void prv_blend_horizontal_line_raw(GContext *ctx, int16_t y, int16_t x1, int16_t x2,
|
||||
GColor color) {
|
||||
PBL_ASSERTN(ctx);
|
||||
|
@ -212,7 +212,7 @@ T_STATIC void prv_blend_horizontal_line_raw(GContext *ctx, int16_t y, int16_t x1
|
|||
}
|
||||
|
||||
// This function draws vertical line with blending, given values have to be clipped and adjusted
|
||||
// clip_box and draw_box respecively.
|
||||
// clip_box and draw_box respectively.
|
||||
T_STATIC void prv_blend_vertical_line_raw(GContext *ctx, int16_t x, int16_t y1, int16_t y2,
|
||||
GColor color) {
|
||||
PBL_ASSERTN(ctx);
|
||||
|
|
|
@ -114,7 +114,7 @@ bool gtransform_is_equal(const GTransform * const t1, const GTransform * const t
|
|||
//////////////////////////////////////
|
||||
/// Modifying Transforms
|
||||
//////////////////////////////////////
|
||||
// Note that t_new can be set to either of t1 or t2 safely to do in place muliplication
|
||||
// Note that t_new can be set to either of t1 or t2 safely to do in place multiplication
|
||||
// Note this operation is not commutative. The operation is as follows t_new = t1 * t2
|
||||
void gtransform_concat(GTransform *t_new, const GTransform *t1, const GTransform * t2) {
|
||||
if ((!t_new) || (!t1) || (!t2)) {
|
||||
|
|
|
@ -171,7 +171,7 @@ bool gtransform_is_equal(const GTransform * const t1, const GTransform * const t
|
|||
//////////////////////////////////////
|
||||
//! Concatenates two transformation matrices and returns the resulting matrix in t1
|
||||
//! The operation performed is t_new = t1*t2. This order is not commutative so be careful
|
||||
//! when contactenating the matrices.
|
||||
//! when concatenating the matrices.
|
||||
//! Note t_new can safely be be the same pointer as t1 or t2.
|
||||
//! @param t_new Pointer to destination transformation matrix
|
||||
//! @param t1 Pointer to transformation matrix to concatenate with t2 where t_new = t1*t2
|
||||
|
|
|
@ -350,7 +350,7 @@ void gpoint_sort(GPoint *points, size_t num_points, GPointComparator comparator,
|
|||
#define GPOINT_PRECISE_PRECISION FIXED_S16_3_PRECISION
|
||||
#define GPOINT_PRECISE_FACTOR FIXED_S16_3_FACTOR
|
||||
|
||||
//! Internal respresentation of a point
|
||||
//! Internal representation of a point
|
||||
//! 1 bit for sign, 12 bits represent the coordinate, 3 bits represent the precision
|
||||
//! Supports -4096.000 px to 4095.875 px resolution
|
||||
typedef struct __attribute__ ((__packed__)) GPointPrecise {
|
||||
|
@ -673,7 +673,7 @@ typedef struct {
|
|||
#define GEdgeInsets(...) \
|
||||
GEdgeInsetsN(__VA_ARGS__, GEdgeInsets4, GEdgeInsets3, GEdgeInsets2, GEdgeInsets1)(__VA_ARGS__)
|
||||
|
||||
//! Returns a rectangle that is shrinked or expanded by the given edge insets.
|
||||
//! Returns a rectangle that is shrunk or expanded by the given edge insets.
|
||||
//! @note The rectangle is standardized and then the inset parameters are applied.
|
||||
//! If the resulting rectangle would have a negative height or width, a GRectZero is returned.
|
||||
//! @param rect The rectangle that will be inset
|
||||
|
@ -1065,7 +1065,7 @@ GBitmap *gbitmap_create_with_resource_system(ResAppNum app_num, uint32_t resourc
|
|||
//! @internal
|
||||
//! @see gbitmap_init_with_resource
|
||||
//! @param app_num The app's resource bank number
|
||||
//! @return true if we were sucessful, false otherwise
|
||||
//! @return true if we were successful, false otherwise
|
||||
bool gbitmap_init_with_resource_system(GBitmap* bitmap, ResAppNum app_num, uint32_t resource_id);
|
||||
|
||||
//! @internal
|
||||
|
@ -1352,7 +1352,7 @@ typedef struct PACKED {
|
|||
typedef Fixed_S32_16 GTransformNumber;
|
||||
|
||||
//! @internal
|
||||
//! Data structure that contains the internal representation of a 3x3 tranformation matrix
|
||||
//! Data structure that contains the internal representation of a 3x3 transformation matrix
|
||||
//! The transformation matrix will be expressed as follows:
|
||||
//! [ a b 0 ]
|
||||
//! [ c d 0 ]
|
||||
|
|
|
@ -53,7 +53,7 @@ typedef enum {
|
|||
GTextOverflowModeFill
|
||||
} GTextOverflowMode;
|
||||
|
||||
//! Text aligment controls the way the text is aligned inside the box the text is drawn into.
|
||||
//! Text alignment controls the way the text is aligned inside the box the text is drawn into.
|
||||
//! @see graphics_draw_text
|
||||
//! @see text_layer_set_text_alignment
|
||||
typedef enum {
|
||||
|
@ -138,7 +138,7 @@ void graphics_text_init(void);
|
|||
|
||||
//! Draw text into the current graphics context, using the context's current text color.
|
||||
//! The text will be drawn inside a box with the specified dimensions and
|
||||
//! configuration, with clipping occuring automatically.
|
||||
//! configuration, with clipping occurring automatically.
|
||||
//! @param ctx The destination graphics context in which to draw
|
||||
//! @param text The zero terminated UTF-8 string to draw
|
||||
//! @param font The font in which the text should be set
|
||||
|
|
|
@ -267,7 +267,7 @@ static bool prv_line_iter_is_vertical_overflow(const LineIterState* const line_i
|
|||
// if we're not rendering the first line.
|
||||
// - This, because the user does not expect to see more text drawn below, after the '...'.
|
||||
// - The first-line exception means that text, and therefore the telltale
|
||||
// ellipsis, will always be visisble.
|
||||
// ellipsis, will always be visible.
|
||||
if ((text_box_params->overflow_mode == GTextOverflowModeTrailingEllipsis ||
|
||||
text_box_params->overflow_mode == GTextOverflowModeFill) &&
|
||||
line_iter_state->current->origin.y != text_box_params->box.origin.y) {
|
||||
|
@ -791,11 +791,11 @@ static inline void prv_walk_lines_down(Iterator* const line_iter, TextLayout* co
|
|||
const Word word_before_rendering = *current_word_ref;
|
||||
const OrphanLineState orphan_state = prv_capture_orphan_state(line);
|
||||
|
||||
// When repeating text to prevent orhpans we could run into the situation where repeating text
|
||||
// When repeating text to prevent orphans we could run into the situation where repeating text
|
||||
// pushes down the remaining text far enough so it ends up on yet another page. This would
|
||||
// enter an infinite loop.
|
||||
// To avoid that, we only apply this strategy, when it's "safe" to do so (in theory, there's
|
||||
// still the propability to run into this scenario if the perimeter isn't vertically symmetric).
|
||||
// still the probability to run into this scenario if the perimeter isn't vertically symmetric).
|
||||
// The chosen number should be large enough for the previous line, the orphan line plus some
|
||||
// buffer.
|
||||
const int num_safe_lines = 3;
|
||||
|
@ -823,7 +823,7 @@ render_line: {} // this {} is just an empty statement that both C and our linter
|
|||
if (is_orphan) {
|
||||
*current_word_ref = prev_line_word;
|
||||
prv_apply_orphan_state(&orphan_state, line);
|
||||
avoiding_orphans = false; // prevent infinte loops
|
||||
avoiding_orphans = false; // prevent infinite loops
|
||||
goto render_line;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue