MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / checkPins

Method checkPins

external/floppybridge/src/SuperCardProInterface.cpp:344–367  ·  view source on GitHub ↗

Checks the pins from boards that support it

Source from the content-addressed store, hash-verified

342
343// Checks the pins from boards that support it
344bool SCPInterface::checkPins() {
345 SCPResponse response;
346
347 selectDrive(true);
348 bool ret = sendCommand(SCPCommand::DoCMD_STATUS, response);
349
350 if (!ret) {
351 if (!m_motorIsEnabled) selectDrive(false);
352 return false;
353 }
354
355 unsigned char bytes[2];
356 if (m_comPort.read(bytes, 2) != 2) {
357 if (!m_motorIsEnabled) selectDrive(false);
358 return false;
359 }
360 if (!m_motorIsEnabled) selectDrive(false);
361
362 uint16_t status = (bytes[1] | (bytes[0] << 8));
363 m_isWriteProtected = (status & (1 << 7)) == 0;
364 m_diskInDrive = (status & (1 << 6)) !=0;
365 m_isAtTrack0 = (status & (1 << 5)) == 0;
366 return true;
367}
368
369// Search for track 0
370bool SCPInterface::findTrack0() {

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected