Publish VCC Plus OSS source distribution for 3.6.2 build 60
This commit is contained in:
commit
c652a5276d
1192 files changed
+272368
No files matched your search
@@ -0,0 +1,52 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#include <vcc/ssc.h>
|
||||
#include "internal.h"
|
||||
|
||||
// CMOC accepts volatile but does not implement its C semantics. Use one
|
||||
// explicit bus read per poll; a second read must never reuse the first value.
|
||||
asm unsigned char ssc_status(void)
|
||||
{
|
||||
asm {
|
||||
ldb $FF7E
|
||||
andb #$E0
|
||||
}
|
||||
}
|
||||
|
||||
asm unsigned char ssc_try_write(unsigned char value)
|
||||
{
|
||||
asm {
|
||||
tst $FF7E
|
||||
bpl @busy
|
||||
ldb 3,s ; low byte of first CMOC argument
|
||||
stb $FF7E
|
||||
ldb #1
|
||||
bra @done
|
||||
@busy clrb
|
||||
@done
|
||||
}
|
||||
}
|
||||
|
||||
asm void ssc_reset(void)
|
||||
{
|
||||
asm {
|
||||
ldb #1
|
||||
stb $FF7D
|
||||
clrb
|
||||
stb $FF7D
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char ssc_write_bytes(const unsigned char *bytes, unsigned int count,
|
||||
unsigned int poll_limit)
|
||||
{
|
||||
while (count) {
|
||||
unsigned int remaining = poll_limit;
|
||||
while (remaining && !ssc_try_write(*bytes))
|
||||
--remaining;
|
||||
if (!remaining)
|
||||
return SSC_TIMEOUT;
|
||||
++bytes;
|
||||
--count;
|
||||
}
|
||||
return SSC_OK;
|
||||
}
|
||||
Reference in new issue
Block a user