mirror of
https://github.com/erichelgeson/BlueSCSI.git
synced 2024-06-13 12:29:42 +00:00
Compare commits
1 Commits
92986e3b7c
...
ce5761d814
Author | SHA1 | Date | |
---|---|---|---|
|
ce5761d814 |
|
@ -1936,9 +1936,6 @@ byte onReadBuffer(SCSI_DEVICE *dev, const byte *cdb)
|
|||
{
|
||||
byte mode = cdb[1] & 7;
|
||||
unsigned m_scsi_buf_size = 0;
|
||||
#if DEBUG > 0
|
||||
uint32_t allocLength = ((uint32_t)cdb[6] << 16) | ((uint32_t)cdb[7] << 8) | cdb[8];
|
||||
#endif
|
||||
|
||||
LOGN("-ReadBuffer");
|
||||
LOGHEXN(mode);
|
||||
|
@ -1958,6 +1955,7 @@ byte onReadBuffer(SCSI_DEVICE *dev, const byte *cdb)
|
|||
writeDataPhase(4 + m_scsi_buf_size, m_buf);
|
||||
|
||||
#if DEBUG > 0
|
||||
uint32_t allocLength = ((uint32_t)cdb[6] << 16) | ((uint32_t)cdb[7] << 8) | cdb[8];
|
||||
for (unsigned i = 0; i < allocLength; i++) {
|
||||
LOGHEX(m_scsi_buf[i]);LOG(" ");
|
||||
}
|
||||
|
|
|
@ -100,6 +100,18 @@ enum SCSI_DEVICE_TYPE
|
|||
|
||||
#define SD_CS PA4 // SDCARD:CS
|
||||
|
||||
// Built-in LED
|
||||
#define LED PC13
|
||||
#define LED_MODE GPIO_OUTPUT_OD
|
||||
|
||||
// External LED
|
||||
#define LED2 PA0
|
||||
#define LED2_MODE GPIO_OUTPUT_PP
|
||||
|
||||
// LED control
|
||||
#define LED_ON() gpio_write(LED, (LED_MODE == GPIO_OUTPUT_PP) ? low : high); gpio_write(LED2, (LED_MODE == GPIO_OUTPUT_PP) ? low : high);
|
||||
#define LED_OFF() gpio_write(LED, (LED_MODE == GPIO_OUTPUT_PP) ? high : low); gpio_write(LED2, (LED_MODE == GPIO_OUTPUT_PP) ? high : low);
|
||||
|
||||
// Image Set Selector
|
||||
#ifdef XCVR
|
||||
#define IMAGE_SELECT1 PC14
|
||||
|
@ -117,26 +129,10 @@ enum SCSI_DEVICE_TYPE
|
|||
// Virtual pin (Arduio compatibility is slow, so make it MCU-dependent)
|
||||
#define PA(BIT) (BIT)
|
||||
#define PB(BIT) (BIT+16)
|
||||
#define PC(BIT) (BIT+32)
|
||||
|
||||
// Virtual pin decoding
|
||||
#define GPIOREG(VPIN) ((VPIN)>=16?((VPIN)>=32?PCREG:PBREG):PAREG)
|
||||
#define GPIOREG(VPIN) ((VPIN)>=16?PBREG:PAREG)
|
||||
#define BITMASK(VPIN) (1<<((VPIN)&15))
|
||||
|
||||
// Built-in LED
|
||||
#define LED PC13
|
||||
#define vLED PC(13)
|
||||
#define LED_MODE GPIO_OUTPUT_OD
|
||||
|
||||
// External LED
|
||||
#define LED2 PA0
|
||||
#define vLED2 PA(0)
|
||||
#define LED2_MODE GPIO_OUTPUT_PP
|
||||
|
||||
// LED control
|
||||
#define LED_ON() GPIOREG(vLED)->BSRR = BITMASK(vLED) << (LED_MODE == GPIO_OUTPUT_PP ? 0 : 16); GPIOREG(vLED2)->BSRR = BITMASK(vLED2) << (LED2_MODE == GPIO_OUTPUT_PP ? 0 : 16);
|
||||
#define LED_OFF() GPIOREG(vLED)->BSRR = BITMASK(vLED) << (LED_MODE == GPIO_OUTPUT_PP ? 16 : 0); GPIOREG(vLED2)->BSRR = BITMASK(vLED2) << (LED2_MODE == GPIO_OUTPUT_PP ? 16 : 0);
|
||||
|
||||
#define vATN PA(8) // SCSI:ATN
|
||||
#define vBSY PA(9) // SCSI:BSY
|
||||
#define vACK PA(10) // SCSI:ACK
|
||||
|
|
Loading…
Reference in New Issue
Block a user