In fact, some symbols have long been introduced in my logs. For details, see the second log "What do some symbols in the. Bat configuration file mean?". I did not learn it very well at that time. Today, my sister-in-law asked me to sort out a log to facilitate later students to learn.
In fact, these files are all batch files. For specific commands, refer to Windows shell programming commands.
The symbols in the title of the article are not common punctuation marks we often see. Do not think about the meaning of the C language. The same symbol has different meanings in different environments. The above mentioned symbols are generally stored in the following important files: Platform. bib, smdk6410.bat, platform. Reg, source, etc. Of course, there must be a. cpp file, but I believe everyone knows it. I will not repeat it here.
First Open Platform. Reg. Here we take smdk6410.bat as an example:
Code ; ------------ I2C bus driver ------------------------------------------------
If bsp_noi2c!
; I2C bus driver
[HKEY_LOCAL_MACHINE \ drivers \ builtin \ IIC]
"Prefix" = "IIC"
"DLL" = "maid"
"Order" = DWORD: 5
"Index" = DWORD: 0
"Mode" = DWORD: 1; Mode: 0 = polling, 1 = interrupt
"Slaveaddress" = DWORD: 0; bus driver's slave address
"Friendlyname" = "IIC bus driver"
"Iclass" = "{A32942B7-920C-486b-B0E6-92A702A99B35}"; power-manageable generic
Endif bsp_noi2c!
;-------------------------------------------------------------------------
The first line does not need to be said; it indicates a comment. Focus on if bsp_noi2c! And endif bsp_noi2c !, It can be understood literally according to If endif. I believe it is not difficult, but here it is! What is the role? Sell a token first and continue reading it. Take I2C as an example. Open Platform. bib with the following content:
Code ; ------------------ I2C bus driver -------------------------------------------------------
If bsp_noi2c!
Cloud6410_iic.dll $ (_ flatreleasedir) \ cloud6410_iic.dll NK Shk
Endif bsp_noi2c!
; Timeout ;---------------------------------------------------------------------------------------
We can see that there is still if bsp_noi2c! And endif bsp_noi2c !, It must be consistent with the above. Continue to look down, or take I2C as an example, open smdk641.bat, you can see the following content:
Set bsp_noi2c =
Set bsp_nospi = 1
@ REM WiFi can be abled when SPI is diabled
Set bsp_nowifi = 1
I believe this is a bit of an eye-catching. As mentioned above, if bsp_noi2c! Bsp_noi2c! Whether the variable is defined in smdk6410.bat. Here set bsp_noi2c = is the environment variable of I2C, followed by the Registry and. bib can determine through if and else, and then execute the content between If and Else. If the value is equal to 1, for example, set bsp_nowifi = 1, it indicates that the WiFi environment variable is not set. Therefore, even if it is defined between If and else, for example:
If bsp_nowifi!
Cloud6410_wifi.dll $ (_ flatreleasedir) \ cloud6410_wifi.dll NK Shk
Endif bsp_nowifi!
So it will not execute the content between If and Else. Here, you can understand the exclamation point as the front set. Of course, you can add the environment variables in pb6.0, which is not described here. Careful people may also find @ REM WiFi can be abled when SPI is diabled. What's the @ here? It should be combined with @ REM to indicate comments. As for #, we take the source file in camera as an example:
Code ! If "$ (bsp_smdk6410)" = "1"
# $ (_ Targetplatroot) \ Lib \ $ (_ cpuindpath) \ s5k4ba_module.lib
$ (_ Targetplatroot) \ Lib \ $ (_ cpuindpath) \ ov9650_module.lib
# $ (_ Targetplatroot) \ Lib \ $ (_ cpuindpath) \ saa7113_module.lib
! Endif
The samsung6410 I use has saa7113 and ov9650. How can I choose? One of them is to view your Linked Library Under the source, so you need to comment out if you don't need it. Here the # is the meaning of the comment.
Let's take another example to review the batch processing file:
For example
Set bsp_debugport = serial_uart0
Set is used to set an environment variable bsp_debugport, which indicates that serial_uart0 indicates that the BSP debug port is serial port 0, depending on the specific implementation code.
@ REM is similar to # comment out a row
$ () Is the environment variable in the reference brackets
For example:
Set _ targetplatroot = "C: \ wince5.0 \ platform"
Set-cpuindpath = armlib
$ (_ Targetplatroot) \ Lib \ $ (_ cpuindpath) \ ov9650_module.lib
In fact, this path is equivalent
"C: \ wince5.0 \ platform \ Lib \ armlib \ 0v9650_module.lib"