The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Is there an SD card present?
01-12-2017, 08:57 AM
Post: #1
Is there an SD card present?
Hi all,

I've been writing a wrapper around the ARCHIVE and RESTORE functions to do a system backup complete with stack contents, flags and current PATH either to the SD card if one is present or to Flash ROM if not. This is on a 50g.

I do have a way of detecting the presence of an SD card using the following in userRPL:

Code:

%%HP: T(3)A(R)F(.);
\<<
  :3: X
  @ Make sure last args are saved @
  RCLF -55 CF \-> n f \<<
  @ Try to recall something from port 3 @
  IFERR n RCL
  THEN
    @ Couldn't RCL it, so try and STO something @
    1 SWAP
    IFERR STO
    @ Assume no SD card if we can't @
    THEN DROP2 0
    ELSE n PURGE 1
    END
  @ No error RCL'ing so we must have an SD card @
  ELSE DROP 1
  END
  f STOF
  \>>
\>>

It just seems a bit long-winded having to do all of this probing in port 3 just to see if there's an SD card present. Is there not a SysEval or something else that will give me the same information? Running search engine queries to find this information throws up oodles of documents explaining how to use an SD card assuming one is present, not how to detect its presence in the first place.

Any ideas?

Cheers,
G. Stewart.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Is there an SD card present? - grsbanks - 01-12-2017 08:57 AM
RE: Is there an SD card present? - MNH - 01-12-2017, 02:35 PM



User(s) browsing this thread: 1 Guest(s)