regime.spin

Du hast ein Betriebssystem für den Hive geschrieben oder beschäftigst dich mit den grundlegenden Systemfunktionen, dann bist du hier richtig!
Antworten
Benutzeravatar
PIC18F2550
Beiträge: 2832
Registriert: Fr 30. Sep 2011, 13:08

regime.spin

Beitrag 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.
Gruß
PIC18F2550

drone265/278
Barbarus hic ergo sum, quia non intellegor ulli.
Ein Barbar bin ich hier, da ich von keinem verstanden werde.
ʎɐqǝ ıǝq ɹnʇɐʇsɐʇ ǝuıǝ ɹǝpǝıʍ ǝıu ǝɟnɐʞ ɥɔı ´uuɐɯ ɥo
Benutzeravatar
drohne235
Administrator
Beiträge: 2284
Registriert: So 24. Mai 2009, 10:35
Wohnort: Lutherstadt Wittenberg
Kontaktdaten:

Re: regime.spin

Beitrag 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.
"Ob Sie denken, dass Sie es können, oder ob Sie denken, dass Sie es nicht können - in beiden Fällen haben Sie recht." Henry Ford
Andrio
Beiträge: 1
Registriert: Mo 22. Dez 2014, 12:01

Re: regime.spin

Beitrag 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.
Decrease your exam stress by using our 70-687 exam and best quality Test-king.com We provide with 100% pass guarantee along with www.pittstate.edu and Southern California University of Health Sciences
U-Held
Beiträge: 69
Registriert: Mi 14. Dez 2011, 22:05

Re: regime.spin

Beitrag 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
Antworten