Buffer from commonpackages (#1520)
* use buffer.ts from common packages * updated common packages * fix descr * fix double description * restore pin descr
This commit is contained in:
@ -38,33 +38,4 @@ namespace pins {
|
||||
buf.setNumber(format, 0, value)
|
||||
pins.i2cWriteBuffer(address, buf, repeated)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the size in bytes of specified number format.
|
||||
*/
|
||||
//%
|
||||
export function sizeOf(format: NumberFormat) {
|
||||
switch (format) {
|
||||
case NumberFormat.Int8LE:
|
||||
case NumberFormat.UInt8LE:
|
||||
case NumberFormat.Int8BE:
|
||||
case NumberFormat.UInt8BE:
|
||||
return 1;
|
||||
case NumberFormat.Int16LE:
|
||||
case NumberFormat.UInt16LE:
|
||||
case NumberFormat.Int16BE:
|
||||
case NumberFormat.UInt16BE:
|
||||
return 2;
|
||||
case NumberFormat.Int32LE:
|
||||
case NumberFormat.Int32BE:
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface Buffer {
|
||||
[index: number]: number;
|
||||
// rest defined in buffer.cpp
|
||||
}
|
||||
|
Reference in New Issue
Block a user