forked from nuttx/nuttx-update
tools/parsetrace.py: fix typo lenght -> length
Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
parent
a59f59b9f5
commit
33d717d3a0
6 changed files with 12 additions and 12 deletions
|
@ -142,7 +142,7 @@
|
||||||
/* Bits 1-3: Reserved */
|
/* Bits 1-3: Reserved */
|
||||||
#define ADC_ETC_TRIG_CTRL_TRIG_MODE (1 << 4) /* Bit 4: Sotware trigger select */
|
#define ADC_ETC_TRIG_CTRL_TRIG_MODE (1 << 4) /* Bit 4: Sotware trigger select */
|
||||||
/* Bits 5-7: Reserved */
|
/* Bits 5-7: Reserved */
|
||||||
#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT (8) /* Bits 8-11: TRIG chain lenght to the ADC */
|
#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT (8) /* Bits 8-11: TRIG chain length to the ADC */
|
||||||
#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN_MASK (0x7 << ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT)
|
#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN_MASK (0x7 << ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT)
|
||||||
#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN(n) (((uint32_t)(n) << ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT) & ADC_ETC_TRIG_CTRL_TRIG_CHAIN_MASK)
|
#define ADC_ETC_TRIG_CTRL_TRIG_CHAIN(n) (((uint32_t)(n) << ADC_ETC_TRIG_CTRL_TRIG_CHAIN_SHIFT) & ADC_ETC_TRIG_CTRL_TRIG_CHAIN_MASK)
|
||||||
/* Bit 11: Reserved */
|
/* Bit 11: Reserved */
|
||||||
|
|
|
@ -1915,7 +1915,7 @@ int sam_dmarxsetup(DMA_HANDLE handle, uint32_t paddr, uint32_t maddr,
|
||||||
* maddr - array of memory addresses (i.e. destination addresses)
|
* maddr - array of memory addresses (i.e. destination addresses)
|
||||||
* paddr - peripheral address (i.e. source address)
|
* paddr - peripheral address (i.e. source address)
|
||||||
* nbytes - number of bytes to transfer
|
* nbytes - number of bytes to transfer
|
||||||
* ndescrs - number of descriptors (i.e. the lenght of descr array)
|
* ndescrs - number of descriptors (i.e. the length of descr array)
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -350,7 +350,7 @@ int sam_dmarxsetup(DMA_HANDLE handle, uint32_t paddr,
|
||||||
* maddr - array of memory addresses (i.e. destination addresses)
|
* maddr - array of memory addresses (i.e. destination addresses)
|
||||||
* paddr - peripheral address (i.e. source address)
|
* paddr - peripheral address (i.e. source address)
|
||||||
* nbytes - number of bytes to transfer
|
* nbytes - number of bytes to transfer
|
||||||
* ndescrs - number of descriptors (i.e. the lenght of descr array)
|
* ndescrs - number of descriptors (i.e. the length of descr array)
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -464,7 +464,7 @@ static ssize_t esp_write(struct file *filep, const char *data, size_t len)
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
/* Check if the lenght to be updated, considering the current position,
|
/* Check if the length to be updated, considering the current position,
|
||||||
* is valid. The number of LEDs to be updated should, starting from the
|
* is valid. The number of LEDs to be updated should, starting from the
|
||||||
* current offset should be less than the LED strip total length.
|
* current offset should be less than the LED strip total length.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -464,7 +464,7 @@ static ssize_t esp_write(struct file *filep, const char *data, size_t len)
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
/* Check if the lenght to be updated, considering the current position,
|
/* Check if the length to be updated, considering the current position,
|
||||||
* is valid. The number of LEDs to be updated should, starting from the
|
* is valid. The number of LEDs to be updated should, starting from the
|
||||||
* current offset should be less than the LED strip total length.
|
* current offset should be less than the LED strip total length.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -484,14 +484,14 @@ class TraceDecoder(SymbolTables):
|
||||||
return "%s", length, fmt % value
|
return "%s", length, fmt % value
|
||||||
|
|
||||||
def extract_string(self, fmt, data):
|
def extract_string(self, fmt, data):
|
||||||
lenght = 0
|
length = 0
|
||||||
if fmt == "%.*s":
|
if fmt == "%.*s":
|
||||||
lenght = int.from_bytes(
|
length = int.from_bytes(
|
||||||
data[:4], byteorder=self.elfinfo["byteorder"], signed=True
|
data[:4], byteorder=self.elfinfo["byteorder"], signed=True
|
||||||
)
|
)
|
||||||
data = data[4:]
|
data = data[4:]
|
||||||
else:
|
else:
|
||||||
lenght = 0
|
length = 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
string = data.split(b"\x00")[0].decode("utf-8")
|
string = data.split(b"\x00")[0].decode("utf-8")
|
||||||
|
@ -501,17 +501,17 @@ class TraceDecoder(SymbolTables):
|
||||||
data[:size], byteorder=self.elfinfo["byteorder"], signed=False
|
data[:size], byteorder=self.elfinfo["byteorder"], signed=False
|
||||||
)
|
)
|
||||||
string = f"<<0x{address}>>"
|
string = f"<<0x{address}>>"
|
||||||
lenght += size
|
length += size
|
||||||
else:
|
else:
|
||||||
lenght += len(string) + 1
|
length += len(string) + 1
|
||||||
except Exception:
|
except Exception:
|
||||||
size = 4 if self.typeinfo["size_t"] == "uint32" else 8
|
size = 4 if self.typeinfo["size_t"] == "uint32" else 8
|
||||||
address = int.from_bytes(
|
address = int.from_bytes(
|
||||||
data[:size], byteorder=self.elfinfo["byteorder"], signed=False
|
data[:size], byteorder=self.elfinfo["byteorder"], signed=False
|
||||||
)
|
)
|
||||||
string = f"<<0x{address}>>"
|
string = f"<<0x{address}>>"
|
||||||
lenght += size
|
length += size
|
||||||
return "%s", lenght, string
|
return "%s", length, string
|
||||||
|
|
||||||
def extract_point(self, fmt, data):
|
def extract_point(self, fmt, data):
|
||||||
length = 4 if self.typeinfo["size_t"] == "int32" else 8
|
length = 4 if self.typeinfo["size_t"] == "int32" else 8
|
||||||
|
|
Loading…
Reference in a new issue