mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-10 06:30:41 +00:00
handle lower case files and io timing
This commit is contained in:
parent
6496092c3b
commit
c413d79f4f
@ -143,6 +143,5 @@ end
|
||||
// Init SD card FAT filesystem
|
||||
//
|
||||
spiSend(14) // SDINIT
|
||||
spiDelay(100)
|
||||
return spiRecv <> SPI_SLAVE_READY // Is Arduino READY?
|
||||
return spiReady <> 0 // Is Arduino READY?
|
||||
done
|
@ -4,6 +4,7 @@ include "inc/args.plh"
|
||||
include "inc/sdfat.plh"
|
||||
|
||||
const COPY_BUF_SIZE = 8912 // 8K
|
||||
const LOWER_DIFF = 'a' - 'A'
|
||||
|
||||
byte[17] proname
|
||||
byte protype
|
||||
@ -29,14 +30,21 @@ def putWord(val)
|
||||
return putByte(val.0)
|
||||
end
|
||||
|
||||
def charUpper(c)
|
||||
if c >= 'a' and c <= 'z'
|
||||
return c - LOWER_DIFF
|
||||
fin
|
||||
return c
|
||||
end
|
||||
|
||||
def hexByte(hexChars)
|
||||
byte lo, hi
|
||||
|
||||
lo = ^(hexChars + 1) - '0'
|
||||
lo = charUpper(^(hexChars + 1)) - '0'
|
||||
if lo > 9
|
||||
lo = lo - 7
|
||||
fin
|
||||
hi = ^hexChars - '0'
|
||||
hi = charUpper(^hexChars) - '0'
|
||||
if hi > 9
|
||||
hi = hi - 7
|
||||
fin
|
||||
@ -44,7 +52,7 @@ def hexByte(hexChars)
|
||||
end
|
||||
|
||||
def hexWord(hexChars)
|
||||
return (hexByte(hexChars + 2) << 8) | hexByte(hexChars)
|
||||
return (hexByte(hexChars) << 8) | hexByte(hexChars + 2)
|
||||
end
|
||||
|
||||
def mkProName(fatName, proName, proType, proAux)
|
||||
|
Loading…
x
Reference in New Issue
Block a user