mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
atsame5x: reduce heap allocation
This commit is contained in:
@@ -424,6 +424,11 @@ func (e CANRxBufferElement) Data() []byte {
|
||||
return e.DB[:CANDlcToLength(e.DLC, e.FDF)]
|
||||
}
|
||||
|
||||
// Length returns its actual length.
|
||||
func (e CANRxBufferElement) Length() byte {
|
||||
return CANDlcToLength(e.DLC, e.FDF)
|
||||
}
|
||||
|
||||
// CANDlcToLength() converts a DLC value to its actual length.
|
||||
func CANDlcToLength(dlc byte, isFD bool) byte {
|
||||
length := dlc
|
||||
|
||||
Reference in New Issue
Block a user