mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
docs: fix typos in comments
[skip_ci]
This commit is contained in:
parent
24200e7424
commit
8cfa5da1ce
@ -1,7 +1,7 @@
|
||||
// clang-format off
|
||||
|
||||
/*-----------------------------------------------------------------------/
|
||||
/ Low level disk interface modlue include file (C)ChaN, 2019 /
|
||||
/ Low level disk interface module include file (C)ChaN, 2019 /
|
||||
/-----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _DISKIO_DEFINED
|
||||
@ -42,7 +42,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
||||
#define STA_PROTECT 0x04 /* Write protected */
|
||||
|
||||
|
||||
/* Command code for disk_ioctrl fucntion */
|
||||
/* Command code for disk_ioctrl function */
|
||||
|
||||
/* Generic command (Used by FatFs) */
|
||||
#define CTRL_SYNC 0 /* Complete pending write process (needed at FF_FS_READONLY == 0) */
|
||||
|
@ -1319,7 +1319,7 @@ static void gen_numname (
|
||||
seq = (UINT)sreg;
|
||||
}
|
||||
|
||||
/* itoa (hexdecimal) */
|
||||
/* itoa (hexadecimal) */
|
||||
i = 7;
|
||||
do {
|
||||
c = (BYTE)((seq % 16) + '0');
|
||||
@ -1628,7 +1628,7 @@ static void get_fileinfo (
|
||||
fno->altname[di] = 0; /* Terminate the SFN (null string means SFN is invalid) */
|
||||
|
||||
if (fno->fname[0] == 0) { /* If LFN is invalid, altname[] needs to be copied to fname[] */
|
||||
if (di == 0) { /* If LFN and SFN both are invalid, this object is inaccesible */
|
||||
if (di == 0) { /* If LFN and SFN both are invalid, this object is inaccessible */
|
||||
fno->fname[di++] = '?';
|
||||
} else {
|
||||
for (si = di = 0, lcf = NS_BODY; fno->altname[si]; si++, di++) { /* Copy altname[] to fname[] with case information */
|
||||
@ -1987,7 +1987,7 @@ static FRESULT mount_volume ( /* FR_OK(0): successful, !=0: an error occurred */
|
||||
|
||||
/* Find an FAT volume on the drive */
|
||||
fmt = find_volume(fs, LD2PT(vol));
|
||||
if (fmt == 4) return FR_DISK_ERR; /* An error occured in the disk I/O layer */
|
||||
if (fmt == 4) return FR_DISK_ERR; /* An error occurred in the disk I/O layer */
|
||||
if (fmt >= 2) return FR_NO_FILESYSTEM; /* No FAT volume is found */
|
||||
bsect = fs->winsect; /* Volume location */
|
||||
|
||||
@ -2218,7 +2218,7 @@ FRESULT f_open (
|
||||
}
|
||||
}
|
||||
else { /* Open an existing file */
|
||||
if (res == FR_OK) { /* Is the object exsiting? */
|
||||
if (res == FR_OK) { /* Is the object existing? */
|
||||
if (dj.obj.attr & AM_DIR) { /* File open against a directory */
|
||||
res = FR_NO_FILE;
|
||||
} else {
|
||||
@ -2654,7 +2654,7 @@ FRESULT f_opendir (
|
||||
FREE_NAMBUF();
|
||||
if (res == FR_NO_FILE) res = FR_NO_PATH;
|
||||
}
|
||||
if (res != FR_OK) dp->obj.fs = 0; /* Invalidate the directory object if function faild */
|
||||
if (res != FR_OK) dp->obj.fs = 0; /* Invalidate the directory object if function failed */
|
||||
|
||||
LEAVE_FF(fs, res);
|
||||
}
|
||||
@ -2986,7 +2986,7 @@ FRESULT f_mkdir (
|
||||
st_clust(fs, fs->win + SZDIRE, pcl);
|
||||
fs->wflag = 1;
|
||||
}
|
||||
res = dir_register(&dj); /* Register the object to the parent directoy */
|
||||
res = dir_register(&dj); /* Register the object to the parent directory */
|
||||
}
|
||||
}
|
||||
if (res == FR_OK) {
|
||||
|
@ -252,7 +252,7 @@ typedef struct {
|
||||
WORD ftime; /* Modified time */
|
||||
BYTE fattrib; /* File attribute */
|
||||
#if FF_USE_LFN
|
||||
TCHAR altname[FF_SFN_BUF + 1];/* Altenative file name */
|
||||
TCHAR altname[FF_SFN_BUF + 1];/* Alternative file name */
|
||||
TCHAR fname[FF_LFN_BUF + 1]; /* Primary file name */
|
||||
#else
|
||||
TCHAR fname[12 + 1]; /* File name */
|
||||
|
@ -189,7 +189,7 @@
|
||||
/ number and only an FAT volume found on the physical drive will be mounted.
|
||||
/ When this function is enabled (1), each logical drive number can be bound to
|
||||
/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk()
|
||||
/ funciton will be available. */
|
||||
/ function will be available. */
|
||||
|
||||
|
||||
#define FF_MIN_SS 512
|
||||
|
@ -467,7 +467,7 @@ void display_init_seq(void) {
|
||||
}
|
||||
|
||||
void display_init(void) {
|
||||
// init peripherials
|
||||
// init peripherals
|
||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
__HAL_RCC_FMC_CLK_ENABLE();
|
||||
|
@ -349,7 +349,7 @@ void display_icon(int x, int y, int w, int h, const void *data,
|
||||
}
|
||||
}
|
||||
|
||||
// see docs/misc/toif.md for defintion of the TOIF format
|
||||
// see docs/misc/toif.md for definition of the TOIF format
|
||||
bool display_toif_info(const uint8_t *data, uint32_t len, uint16_t *out_w,
|
||||
uint16_t *out_h, bool *out_grayscale) {
|
||||
if (len < 12 || memcmp(data, "TOI", 3) != 0) {
|
||||
|
@ -8,7 +8,7 @@ pub type List = ffi::mp_obj_list_t;
|
||||
|
||||
impl List {
|
||||
pub fn alloc(values: &[Obj]) -> Gc<Self> {
|
||||
// SAFETY: Altough `values` are copied into the new list and not mutated,
|
||||
// SAFETY: Although `values` are copied into the new list and not mutated,
|
||||
// `mp_obj_new_list` is taking them through a mut pointer.
|
||||
unsafe {
|
||||
let list = ffi::mp_obj_new_list(values.len(), values.as_ptr() as *mut Obj);
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
Random delay interrupts (RDI) is a contermeasure agains side channel attacks. It
|
||||
Random delay interrupts (RDI) is a contermeasure against side channel attacks. It
|
||||
consists of an interrupt handler that is supposed to be called every millisecond
|
||||
or so. The handler waits for a random number of cpu ticks that is a sample of so
|
||||
called floating mean distribution. That means that the number is the sum of two
|
||||
|
@ -646,10 +646,10 @@ USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev,
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the last transfered packet size.
|
||||
* @brief Returns the last transferred packet size.
|
||||
* @param pdev: Device handle
|
||||
* @param ep_addr: Endpoint Number
|
||||
* @retval Recived Data Size
|
||||
* @retval Received Data Size
|
||||
*/
|
||||
uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ void flash_init(void) {
|
||||
struct stat sb;
|
||||
int r = stat(FLASH_FILE, &sb);
|
||||
|
||||
// (re)create if non existant or wrong size
|
||||
// (re)create if non existent or wrong size
|
||||
if (r != 0 || sb.st_size != FLASH_SIZE) {
|
||||
int fd = open(FLASH_FILE, O_RDWR | O_CREAT | O_TRUNC, (mode_t)0600);
|
||||
ensure(sectrue * (fd >= 0), "open failed");
|
||||
|
@ -55,7 +55,7 @@ void sdcard_init(void) {
|
||||
int r = stat(SDCARD_FILE, &sb);
|
||||
int should_clear = 0;
|
||||
|
||||
// (re)create if non existant or wrong size
|
||||
// (re)create if non existent or wrong size
|
||||
if (r != 0 || sb.st_size != SDCARD_SIZE) {
|
||||
int fd = open(SDCARD_FILE, O_RDWR | O_CREAT | O_TRUNC, (mode_t)0600);
|
||||
ensure(sectrue * (fd >= 0), "open failed");
|
||||
|
@ -32,7 +32,7 @@ _Current mainnet network id:_ 1
|
||||
|
||||
## Key types
|
||||
|
||||
In Shelley two types of keys are used. Payment key and staking key. Payment keys are derived from _m/1852'/1815'/x/[0,1]/y_ paths and are used for holding/transfering funds. Staking keys are derived from _m/1852'/1815'/x/2/0_ paths, thus there is only one staking key per account. They are used for staking operations - certificates, withdrawals. Shelley addresses are built from the combination of hashes of these keys.
|
||||
In Shelley two types of keys are used. Payment key and staking key. Payment keys are derived from _m/1852'/1815'/x/[0,1]/y_ paths and are used for holding/transferring funds. Staking keys are derived from _m/1852'/1815'/x/2/0_ paths, thus there is only one staking key per account. They are used for staking operations - certificates, withdrawals. Shelley addresses are built from the combination of hashes of these keys.
|
||||
|
||||
## Addresses
|
||||
|
||||
|
@ -58,7 +58,7 @@ def _header(typ: int, l: int) -> bytes:
|
||||
elif l < 2 ** 64:
|
||||
return struct.pack(">BQ", typ + 27, l)
|
||||
else:
|
||||
raise NotImplementedError("Length %d not suppported" % l)
|
||||
raise NotImplementedError("Length %d not supported" % l)
|
||||
|
||||
|
||||
def _cbor_encode(value: Value) -> Iterator[bytes]:
|
||||
@ -128,7 +128,7 @@ def _read_length(r: utils.BufferReader, aux: int) -> int:
|
||||
elif aux == _CBOR_UINT64_FOLLOWS:
|
||||
return readers.read_uint64_be(r)
|
||||
else:
|
||||
raise NotImplementedError("Length %d not suppported" % aux)
|
||||
raise NotImplementedError("Length %d not supported" % aux)
|
||||
|
||||
|
||||
def _cbor_decode(r: utils.BufferReader) -> Value:
|
||||
|
@ -28,7 +28,7 @@ DRY_RUN_ALLOWED_FIELDS = ("dry_run", "word_count", "enforce_wordlist", "type")
|
||||
async def recovery_device(ctx: wire.Context, msg: RecoveryDevice) -> Success:
|
||||
"""
|
||||
Recover BIP39/SLIP39 seed into empty device.
|
||||
Recovery is also possible with replugged Trezor. We call this process Persistance.
|
||||
Recovery is also possible with replugged Trezor. We call this process Persistence.
|
||||
User starts the process here using the RecoveryDevice msg and then they can unplug
|
||||
the device anytime and continue without a computer.
|
||||
"""
|
||||
|
@ -17,7 +17,7 @@ if False:
|
||||
from apps.common.paths import Bip32Path
|
||||
|
||||
# This module implements the SLIP-0017 Elliptic Curve Diffie-Hellman algorithm, using a
|
||||
# determinstic hierarchy, see https://github.com/satoshilabs/slips/blob/master/slip-0017.md.
|
||||
# deterministic hierarchy, see https://github.com/satoshilabs/slips/blob/master/slip-0017.md.
|
||||
|
||||
|
||||
async def get_ecdh_session_key(
|
||||
|
@ -71,7 +71,7 @@ async def init_transaction(
|
||||
# Ensure change is correct
|
||||
_check_change(state, tsx_data.outputs)
|
||||
|
||||
# At least two outpus are required, this applies also for sweep txs
|
||||
# At least two outputs are required, this applies also for sweep txs
|
||||
# where one fake output is added. See _check_change for more info
|
||||
if state.output_count < 2:
|
||||
raise signing.NotEnoughOutputsError("At least two outputs are required")
|
||||
|
@ -23,7 +23,7 @@ async def sign_tx(ctx, msg, keychain):
|
||||
node = keychain.derive(msg.address_n)
|
||||
|
||||
if msg.transaction is not None:
|
||||
# if the tranasction oprtation is used to execute code on a smart contract
|
||||
# if the transaction operation is used to execute code on a smart contract
|
||||
if msg.transaction.parameters_manager is not None:
|
||||
parameters_manager = msg.transaction.parameters_manager
|
||||
|
||||
|
@ -31,7 +31,7 @@ Credential selection is supported directly on the device. The `authenticatorGetN
|
||||
* COSE algorithm ES256 (-7): ECDSA using the NIST P-256 curve with SHA-256.
|
||||
* COSE algorithm EdDSA (-8): Pure EdDSA using the Ed25519 curve.
|
||||
|
||||
### Extenstions
|
||||
### Extensions
|
||||
|
||||
* hmac-secret extension.
|
||||
|
||||
|
@ -187,7 +187,7 @@ def grid(
|
||||
spacing: int = 0, # spacing size between cells
|
||||
) -> Area:
|
||||
"""
|
||||
Returns area (tuple of four integers, in pixels) of a cell on i-th possition
|
||||
Returns area (tuple of four integers, in pixels) of a cell on i-th position
|
||||
in a table you define yourself. Example:
|
||||
|
||||
>>> ui.grid(4, n_x=2, n_y=3, start_x=20, start_y=20)
|
||||
@ -219,7 +219,7 @@ RENDER = const(-255)
|
||||
# Event dispatched when components should mark themselves for re-painting.
|
||||
REPAINT = const(-256)
|
||||
|
||||
# How long, in milliseconds, should the layout rendering task sleep betweeen
|
||||
# How long, in milliseconds, should the layout rendering task sleep between
|
||||
# the render calls.
|
||||
_RENDER_DELAY_MS = const(10)
|
||||
|
||||
|
@ -206,11 +206,11 @@ def render_text(
|
||||
if false, the trailing "..." is not shown. This is useful when the rendered text is
|
||||
in fact paginated.
|
||||
|
||||
`font` specifies the default font, but that can be overriden by font instructions
|
||||
`font` specifies the default font, but that can be overridden by font instructions
|
||||
in `items`.
|
||||
`fg` specifies default foreground color, which can also be overriden by instructions
|
||||
`fg` specifies default foreground color, which can also be overridden by instructions
|
||||
in `items`.
|
||||
`bg` specifies background color. This cannot be overriden.
|
||||
`bg` specifies background color. This cannot be overridden.
|
||||
|
||||
`offset_x` and `offset_y` specify starting XY position of the text bounding box.
|
||||
`line_width` specifies width of the bounding box. Height of the bounding box is
|
||||
|
@ -9,7 +9,7 @@ if False:
|
||||
IdleCallback = Callable[[], None]
|
||||
|
||||
if __debug__:
|
||||
# Used in `on_close` bellow for memory statistics.
|
||||
# Used in `on_close` below for memory statistics.
|
||||
|
||||
import micropython
|
||||
|
||||
|
@ -85,7 +85,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
### Changed
|
||||
- Clean USB descriptor.
|
||||
- Return firmware_present in Features response.
|
||||
- Don't halt on broken firware, stay in bootloader.
|
||||
- Don't halt on broken firmware, stay in bootloader.
|
||||
|
||||
## 1.2.8 [September 2016]
|
||||
|
||||
|
@ -102,7 +102,7 @@ int signatures_old_ok(void) {
|
||||
}
|
||||
if (0 != ecdsa_verify_digest(&secp256k1, pubkey[sigindex3 - 1],
|
||||
(const uint8_t *)FLASH_META_SIG3,
|
||||
hash)) { // failture
|
||||
hash)) { // failure
|
||||
return SIG_FAIL;
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ void u2fhid_read_start(const U2FHID_FRAME *f) {
|
||||
break;
|
||||
}
|
||||
|
||||
// wait for next commmand/ button press
|
||||
// wait for next command/button press
|
||||
reader->cmd = 0;
|
||||
reader->seq = 255;
|
||||
while (dialog_timeout > 0 && reader->cmd == 0) {
|
||||
@ -644,7 +644,7 @@ void u2f_register(const APDU *a) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Didnt expect to get here
|
||||
// Didn't expect to get here
|
||||
dialog_timeout = 0;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ for fn in sorted(glob.glob("*.png")):
|
||||
name = os.path.splitext(fn)[0]
|
||||
w, h = im.size
|
||||
if w % 8 != 0:
|
||||
raise Exception("Width must be divisable by 8! (%s is %dx%d)" % (fn, w, h))
|
||||
raise Exception("Width must be divisible by 8! (%s is %dx%d)" % (fn, w, h))
|
||||
img = list(im.getdata())
|
||||
hdrs.append("extern const BITMAP bmp_%s;\n" % name)
|
||||
imgs.append("const BITMAP bmp_%s = {%d, %d, bmp_%s_data};\n" % (name, w, h, name))
|
||||
|
@ -198,7 +198,7 @@ usb_standard_get_descriptor(usbd_device *usbd_dev,
|
||||
return USBD_REQ_NOTSUPP;
|
||||
}
|
||||
|
||||
/* Strings with Language ID differnet from
|
||||
/* Strings with Language ID different from
|
||||
* USB_LANGID_ENGLISH_US are not supported */
|
||||
if (req->wIndex != USB_LANGID_ENGLISH_US) {
|
||||
return USBD_REQ_NOTSUPP;
|
||||
|
Loading…
Reference in New Issue
Block a user