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