1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2024-07-20 13:28:56 +00:00

handle lower case files and io timing

This commit is contained in:
dschmenk 2016-08-15 16:08:31 -07:00
parent 6496092c3b
commit c413d79f4f
2 changed files with 12 additions and 5 deletions

View File

@ -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

View File

@ -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)