Seite 1 von 1

regime.spin

Verfasst: Fr 20. Sep 2013, 13:55
von PIC18F2550
So langsam habe ich das Gefühl das ich Nerve. :cry:

Regime.spin

Code: Alles auswählen

PRI cmd_dir|fcnt,stradr,hflag                           'cmd: verzeichnis anzeigen
{{sddir - anzeige verzeichnis}}

  if ios.sdcheckmounted                                 'test ob medium gemounted ist

    hflag := 1
    stradr := os_nxtoken1                               'parameter einlesen
    ios.print(@msg10)                                   
    ios.print(@msg5)
    ios.print(ios.sdvolname)
    ifnot ios.os_error(ios.sddir)                       'verzeichnis öffnen <<------ mit Fehlerbearbeitung
      if str.findCharacter(stradr,"h")
        hflag := 0
      if str.findCharacter(stradr,"w")
        fcnt := cmd_dir_w(hflag)
      else
        fcnt := cmd_dir_l(hflag)                        'dir l
      ios.printnl
      ios.print(@msg10)
      ios.print(@msg9)
      ios.printdec(fcnt)
  else
    ios.os_error(1)
reg-ios.spin

Code: Alles auswählen

PUB sddir                                               'sd-card: verzeichnis wird geöffnet
''funktionsgruppe               : sdcard
''funktion                      : verzeichnis öffnen
''busprotokoll                  : [002]

  bus_putchar1(gc#a_sdOpenDir)
keine Fehlerrückmeldung auch nicht in admflash vorgesehen.

Re: regime.spin

Verfasst: Fr 20. Sep 2013, 15:50
von drohne235
keine Fehlerrückmeldung auch nicht in admflash vorgesehen.
Jo, die Fehlerabfrage könnte man rauslöschen, werd ich bei der nächsten Version machen.

Re: regime.spin

Verfasst: Mo 22. Dez 2014, 12:33
von Andrio
I have 2 questions there once. . 1 can I access sequentially with the adm-fat.spin to a file or streaming is just possible. . 2 How can I read or write geziehlt a Sector on the SD card with the adm-fat.spin.

Re: regime.spin

Verfasst: Fr 26. Dez 2014, 00:00
von U-Held
Hi Andrio,

I don't know whether I understand what you are asking for.

ad 1.

You access a file sequentially by sdgetc/sdputc from reg-ios.spin which calls readCharacter/writeCharacter in adm-fat.spin.

What do you mean with streaming? Using one cog in Regnatix for accessing Administra's SD card functions and another cog in Regnatix to do your desired function? - No Problem I assume. But explain it a bit more in detail what you intend to do.

ad 2.

To access a random sector on the SD card you would have to make readWriteBlock from adm-fat.spin accessible to Regnatix. The other functions for reading/writing bytes operate on the currently open file. Look at readWriteCurrentSector in adm-fat to see how to compute the address for readWriteBlock. But of course accessing a file system this way may well destroy it.

Best Regards,

Dietmar