drivertest.bas

来自「MSP430最基本的应用开发实例」· BAS 代码 · 共 55 行

BAS
55
字号
$regfile = "M103Def.dat"
$crystal = 4000000
'$crystal = 1000000

Dim Testval As Word
Dim Ercode As Byte

' Use Serial 0 for communication with PC-Terminal
$baud = 9600
Config Serialin = Buffered , Size = 20

Open "Com1:" For Binary As #1
' If you use a software-UART, define it with #1
Enable Interrupts

Goto Behindincludes
$Include "FAT16Driver.bas"
Behindincludes:

' Init Port and Card

Print "V1.0 Setup Port and Reset Card ... ";

If Drivecheck() = 1 Then
   Driveinit
Else
  Print #1 , "Card not inserted, check Card!"
  End
End If

Print "OK"

'debug info
Print "DriverTest Starting."

'read the mbr
Call Init()

'create a file on the root directory
Call Createorappendtofile( "NEWFILE.TXT")

'write some data to the file
Ercode = Writedata( "The quick brow fox jumped over the lazy dog!" , 1)

'list the file contents
Call Listfile( "NEWFILE.TXT")

'more debug info
Print "Finished DriverTest."

'Quit
Goto Quit

Quit:
End

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?