├── .gitignore ├── 404.html ├── CNAME ├── LICENSE.txt ├── README.md ├── _config.yml ├── _includes ├── contact.html ├── content.html ├── copyright.html ├── disqus.html ├── footer.html ├── googleanalytics.html ├── header.html ├── nav.html ├── navside.html └── share.html ├── _layouts ├── base.html ├── page.html └── post.html ├── _posts ├── android │ ├── 2015-07-17-build-android-source-code.md │ ├── 2015-07-17-install-adb.md │ ├── 2015-07-20-android-dev-tips.md │ └── 2015-07-22-adb-trouble-shooting.md ├── driver │ ├── 2014-12-31-radxa-display-setting.md │ ├── 2015-01-06-control-led-with-gpio.md │ ├── 2015-05-17-custom-HDMI-resolution.md │ ├── 2015-07-17-boot-process.md │ ├── 2015-07-18-infrared-configuration.md │ ├── 2015-07-18-led-concrol.md │ ├── 2015-07-20-making-bootable-sdcard.md │ ├── 2015-07-20-using-camera-on-rock.md │ └── 2015-12-02-oled-spi.md ├── hardware │ ├── 2014-12-29-differences-between-products.md │ ├── 2014-12-29-products.md │ ├── 2014-12-31-Radxa-Rock-Lite-docs.md │ ├── 2015-01-01-Radxa-Rock-Pro-Specification.md │ ├── 2015-01-05-extension-header.md │ └── 2015-07-21-product-history.md ├── linux │ ├── 2015-01-05-how-to-flash-on-linux.md │ ├── 2015-07-17-build-linux-image.md │ ├── 2015-07-17-build-mainline-kernel.md │ ├── 2015-07-17-build-ubuntu-rootfs.md │ ├── 2015-07-17-install-ROS.md │ ├── 2015-07-17-tty-debug.md │ ├── 2015-07-18-boot-FreeBSD.md │ ├── 2015-07-18-linux-sound.md │ ├── 2015-07-18-linux-vnc-server.md │ └── 2015-07-20-bootloader.md ├── rock2 │ ├── 2015-05-17-rock2-full-baseboard.md │ ├── 2015-05-17-rock2-loader-mode.md │ ├── 2015-05-17-rock2-square-introduction.md │ └── 2015-05-17-rock2-square-resources.md └── start │ ├── 2014-12-28-Flash-image-to-nand-linux.md │ ├── 2014-12-28-Flash-image-to-nand-windows.md │ ├── 2014-12-29-Q-and-A.md │ ├── 2014-12-31-enter-recovery-mode.md │ ├── 2015-07-17-download-to-sdcard.md │ ├── 2015-07-20-unbrick-rock.md │ ├── 2015-07-20-upgrade-nand-from-SD.md │ └── 2015-07-21-firmware-naming.md ├── assets ├── _sass │ ├── _animation.scss │ ├── _nprogress.scss │ ├── _pygments.scss │ └── style.scss ├── css │ └── style.css ├── font │ ├── config.json │ ├── fontello.eot │ ├── fontello.svg │ ├── fontello.ttf │ └── fontello.woff └── js │ ├── jquery.js │ ├── jquery.pjax.js │ ├── nprogress.js │ └── script.js ├── ie.html ├── index.html ├── index.md ├── pages ├── about.html ├── archive.html ├── atom.xml └── rss.xml ├── public ├── codes │ └── oled.tar.gz ├── css │ ├── base.css │ ├── bootstrap.css │ ├── font-awesome.css │ └── highlight.css ├── fonts │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff ├── img │ ├── body_bg.jpg │ ├── oled.jpg │ └── spi_oled.jpg └── js │ ├── base.js │ ├── bootstrap.js │ ├── jquery.js │ ├── jquery.pjax.js │ └── prettify │ ├── lang-apollo.js │ ├── lang-basic.js │ ├── lang-clj.js │ ├── lang-css.js │ ├── lang-dart.js │ ├── lang-erlang.js │ ├── lang-go.js │ ├── lang-hs.js │ ├── lang-lisp.js │ ├── lang-llvm.js │ ├── lang-lua.js │ ├── lang-matlab.js │ ├── lang-ml.js │ ├── lang-mumps.js │ ├── lang-n.js │ ├── lang-pascal.js │ ├── lang-proto.js │ ├── lang-r.js │ ├── lang-rd.js │ ├── lang-scala.js │ ├── lang-sql.js │ ├── lang-tcl.js │ ├── lang-tex.js │ ├── lang-vb.js │ ├── lang-vhdl.js │ ├── lang-wiki.js │ ├── lang-xq.js │ ├── lang-yaml.js │ ├── prettify.css │ ├── prettify.js │ └── run_prettify.js └── sitemap.txt /.gitignore: -------------------------------------------------------------------------------- 1 | _site/ 2 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | title: 404 Not Found Error 4 | --- 5 | 6 |
7 |

404 Not Found Error

8 |
-------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | docs.radxa.us 2 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Su Yan - Released under The MIT License. 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Welcome to Radxa Documents 4 | --- 5 | 6 | # 新手入门 7 | 8 | 如果你是刚接触Radxa Rock的朋友,建议先看一看下面的几篇文档,我相信,会很有帮助的。 9 | 10 | * [也许你应该会想要知道,你手上的是一个什么好东西](http://kevinxiasx.github.io/2014/12/29/products.html) 11 | 12 | * [先要确定你的开发板是哪个版本](http://kevinxiasx.github.io/2015/07/21/product-history.html) 13 | 14 | * [如何获取可刷机的镜像](http://kevinxiasx.github.io/2015/07/21/tiro-read.html) 15 | 16 | * [windows往板子中刷入第一个系统](http://kevinxiasx.github.io/2014/12/28/Flash-image-to-nand-windows.html) 17 | 18 | * [Linux往板子中刷入第一个系统](http://kevinxiasx.github.io/2014/12/28/Flash-image-to-nand-linux.html) 19 | 20 | * [新手使用时,总会有这个那个毛病,你可以先看看这有没有你需要的答案](http://kevinxiasx.github.io/2014/12/29/Q-and-A.html)- 21 | 22 | # Android开发 23 | 24 | android平台已经得到越来越广的使用 25 | 26 | * [android开发,首先应该知道如何编译一个android固件](http://kevinxiasx.github.io/2015/07/17/build-android-firework.html) 27 | 28 | * [烧录固件](http://kevinxiasx.github.io/2014/12/28/Flash-image-to-nand-windows.html) 29 | 30 | * [然后你会需要ADB调试工具去调试你的设备](http://kevinxiasx.github.io/2015/07/17/install-adb.html) 31 | 32 | * [在安装ADB时,出现问题的概率还是蛮高的,你可以看看这](http://kevinxiasx.github.io/2015/07/22/adb-trouble.html) 33 | 34 | * [我们还提供了一些android开始时的小技巧,一起来交流吧](http://kevinxiasx.github.io/2015/07/20/android-tip.html) 35 | 36 | # Linux开发请看 37 | 38 | Linux作为一个开源系统,仍将火热不少年头。更多的文档信息可以点击左侧的"linux开发" 39 | 40 | * [老规矩,先编译一个属于你自己的linux固件](http://kevinxiasx.github.io/2015/07/17/build-Linux-firework.html) 41 | 42 | * [烧录固件](http://kevinxiasx.github.io/2014/12/28/Flash-image-to-nand-linux.html) 43 | 44 | * [如果你希望你固件的内核版本更高一些,看看这](http://kevinxiasx.github.io/2015/07/17/build-kernel3.18+.html) 45 | 46 | 47 | # 硬件相关操作 48 | 49 | 当操作Rock上的硬件设备,或者把Rock连接到各式各样的设备上时,你可以看看这 50 | 51 | * [如果想要利用遥控器来控制设备,你需要看看如何使用红外设备](http://kevinxiasx.github.io/2015/07/18/Infrared-configure.html) 52 | 53 | * [如何控制rock上面的LED灯](http://kevinxiasx.github.io/2015/01/06/control-led-with-gpio.html) 54 | 55 | * [调整HDMI显示的分辨率](http://kevinxiasx.github.io/2015/05/17/HDMI-resolution-adjustment.html) 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | permalink: /:year/:month/:day/:title.html 2 | markdown: kramdown 3 | pygments: true 4 | 5 | kramdown: 6 | input: GFM 7 | 8 | # 作者信息 9 | author: 10 | name: 瑞莎科技-Radxa 11 | email: support@radxa.com 12 | weibo: weibo.com/radxa 13 | github: http://github.com/radxa 14 | 15 | # 站点信息 16 | title: Rock文档 17 | description: 文档资料 18 | rss_url: /pages/atom.xml 19 | 20 | # avatar头像及Favicon 21 | avatar: http://dl.radxa.com/media/logo/RADXA_X_135x135.png 22 | favicon: 23 | 24 | # google analytics 设置 25 | ga: 26 | id: UA-54767140-1 27 | url: docs.radxa.us 28 | 29 | # disqus 设置 30 | disqus: 31 | shortname: radxa-doc -------------------------------------------------------------------------------- /_includes/contact.html: -------------------------------------------------------------------------------- 1 |
 2 | 如果需要更详细更全面的信息,请登陆
 3 | 
 4 | 官方网站     http://radxa.com
 5 | QQ讨论群     339567728
 6 | 中文论坛     http://cn.radxa.com/forum.php
 7 | 
 8 | 另外,本手册所使用的所有源码、固件、工具,都可以登陆以下地址下载
 9 | 国外服务器   http://dl.radxa.com/
10 | 百度云       http://pan.baidu.com/share/home?uk=3108273493#category/type=0
11 | 
12 | 手册内容经小编实际操作,均可正常使用,但因系统以及整理文档等原因
13 | 若出现错误,请谅解,并使用以下邮箱联系我们  kevin@radxa.com 
14 | 
15 | 			Radxa团队
16 |  			2015年7月
17 | 
18 | -------------------------------------------------------------------------------- /_includes/content.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |

[{{ site.locals.content }}]

4 | 7 |
8 | -------------------------------------------------------------------------------- /_includes/copyright.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/disqus.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | Loading Disqus comments... 4 |
-------------------------------------------------------------------------------- /_includes/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /_includes/googleanalytics.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_includes/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ page.title }} | {{ site.title }} 6 | 7 | {% if page.keywords %} 8 | 9 | {% endif %} 10 | 11 | {% if page.description %} 12 | 13 | {% endif %} 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /_includes/nav.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_includes/navside.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 |

7 | 15 |
16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 |
24 |
25 |
26 |
27 | {% for category in site.categories %} 28 |
29 |
30 |

{{ category[0] }}

31 | {% for post in category[1] %} 32 | {{post.title}} 33 | {% endfor %} 34 |
35 |
36 | {% endfor %} 37 |
38 |
39 |

{{ site.locals.tags }}

40 | {% for tag in site.tags %} 41 |
42 |
43 |

44 | {{ tag[0] }} 45 | {{ tag[1].size }} 46 |

47 |
48 |
49 | {% for post in tag[1] %} 50 | 51 | {{post.title}} 52 | 53 | {% endfor %} 54 |
55 |
56 | {% endfor %} 57 |
58 |
59 |
60 |
61 |
62 |
63 |
-------------------------------------------------------------------------------- /_includes/share.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
-------------------------------------------------------------------------------- /_layouts/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include header.html %} 5 | 6 | 7 | {% include nav.html %} 8 |
9 |
10 | {{ content }} 11 | {% include copyright.html %} 12 |
13 | 14 |
15 |
16 | Table of Contents 17 |
    18 |
    19 |
    20 |
    21 | 22 | {% include footer.html %} 23 | {% include googleanalytics.html %} 24 | 25 | -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | --- 4 | 5 |
    6 |

    {{ page.title }}

    7 | {{ content }} 8 |
    9 | 10 | {% include contact.html %} 11 | {% include share.html %} 12 | {% include disqus.html %} -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | --- 4 | 5 |
    6 |

    {{ page.title }}

    7 | {{ content }} 8 |
    9 | 10 | {% include contact.html %} 11 | {% include share.html %} 12 | {% include disqus.html %} 13 | 14 | -------------------------------------------------------------------------------- /_posts/android/2015-07-17-build-android-source-code.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 编译安卓固件 4 | category: Android 5 | tags: android 6 | keywords: firework 7 | --- 8 | 9 | 10 | # Android固件的编译 11 | 12 | 这篇文章将详细介绍安卓固件的编译步骤,不过给radxa rock编译AOSP(Android Open Source Project)整个安卓系统源码是一项大工程,**会很耗费时间和硬盘空间**。推荐的编译主机是Ubuntu 12.04 64位。在我们的测试编译机器上一次完整编译总共花费了35分钟和30G的硬盘空间,我们的配置为Intel 4770处理器(第四代i7,四核八线程,3.4Ghz),16G内存和256G固态硬盘(友情提示: 固态硬盘可以极大提高编译速度). 13 | 14 | ## 1.初始化编译环境 15 | 16 | * 安装JDK 17 | `sudo add-apt-repository ppa:webupd8team/java` 18 | `sudo apt-get update` 19 | `sudo apt-get install oracle-java6-installer` 20 | 21 | * 安装所需要的包 22 | `# sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 g++-multilib mingw32 tofrodos gcc-multilib ia32-libs python-markdown libxml2-utils xsltproc zlib1g-dev:i386` 23 | **(注意: 在Ubuntu 13.10上,已经没有ia32-libs这个包,不需要安装这个包。 )** 24 | 25 | * 安装ARM交叉编译器和编译内核相关依赖 26 | `sudo apt-get install gcc-arm-linux-gnueabihf` 27 | `sudo apt-get install lzop libncurses5-dev` 28 | 29 | 下面两步需要注意,arm是将要编译的目标平台,配置时,会根据此环境变量去arch/$ARCH/configs中寻找配置文件,如果编译时报错,有时会提示找不到配置文件,你需要检查该环境变量是否错误,或者说,该目录下是否有相对应的配置文件。 30 | arm-linux-gnueabihf-则是编译器名字的前面部分,有时你的电脑中已经有该交叉编译工具,但是不在环境变量中,你需要在该环境变量中加入路径名,如CROSS_COMPILE=/user/local/arm-linux-gnueabihf-。 31 | 32 | `export ARCH=arm` 33 | `export CROSS_COMPILE=arm-linux-gnueabihf-` 34 | 35 | * 安装其他所需要的运行库 36 | `sudo apt-get install libssl1.0.0 libssl-dev` 37 | 38 | ## 2.获取Android源码 39 | 40 | * For android 4.2.2 Jelly Bean 41 | `git clone -b radxa/radxa-dev git://git.us.linux-rockchip.org/rk3188_r-box_android4.2.2_sdk.git` 42 | * For android 4.4.2 KitKat 43 | `git clone -b radxa/rock2014 git://git.us.linux-rockchip.org/rk3188_rk3066_r-box_android4.4.2_sdk.git` 44 | 45 | 或者从百度云下载 http://pan.baidu.com/s/1hqorKva (China) 46 | 47 | 注: 国内客户建议从百度云下载,速度较快; rock,rock_pro,rock_lite可以用同一份代码(android 4.4版本), 编译时使用不同的配置即可 48 | 49 | ## 3.编译内核 50 | 51 | * 进入内核文件夹 52 | `cd kernel` 53 | * 配置内核,配置文件存放于/arch/arm/configs/目录下,可以根据需求,修改里面的选项 54 | `make rk3188_box_radxa_rock_pro_hdmi_defconfig ` 55 | * 开始编译 56 | `make kernel.img` 57 | * 进入安卓目录 58 | `cd ..` 59 | * 配置安卓 60 | `lunch radxa_rock_pro-eng` 61 | * 开始编译 62 | `make -j4` 63 | * 编译结束后,打包镜像 64 | `./mkimage.sh ota` 65 | 66 | 最后,你会在rockdev/Image文件夹下得到boot.img recovery.img system.img分区镜像文件, 和 rockdev文件夹下的 update.img整个固件. 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /_posts/android/2015-07-17-install-adb.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 使用ADB调试android Rock 4 | category: Android 5 | tags: [android,adb] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | # 使用ADB调试android Rock 11 | 12 | 我们首先需要 13 | * 运行android平台的rock 14 | * PC机 15 | * USB转OTG线 16 | 17 | ## Linux 18 | 19 | * 我们首先要安装adb工具 20 | `sudo apt-get install android-tools-adb` 21 | 22 | * 然后修改udev规则文件,填入以下内容 23 | `sudo gedit /etc/udev/rules.d/51-android.rules` 24 | > SUBSYSTEM=="usb", ATTR{idVendor}=="2207", MODE="0666", GROUP="plugdev" 25 | 26 | * 现在我们需要让之前的设置马上生效 27 | `sudo udevadm control --reload-rules` 28 | `sudo udevadm trigger` 29 | 30 | * 如果.android文件夹没有存在你的home目录下的话,我们需要创建它,然后在里面添加一个文件 31 | `mkidr -p ~/.android` 32 | `echo 0x2207 >> ~/.android/adb_usb.ini` 33 | 34 | * 然后确认你的android设备开启了debugging的选项 35 | 36 | * 重启一次adb工具 37 | `sudo adb kill-server` 38 | `sudo adb start-server` 39 | 40 | * 现在,我们使用以下命令就可以看到类似这样的一些连接信息 41 | `sudo adb devices` 42 | > 16EM8TBH0Z device 43 | 44 | 连接成功 ! 45 | 46 | ## Windows 47 | 48 | ### 安装adb usb驱动 49 | 50 | 有两种方法做这件工作 51 | 52 | ##### 1.使用工具RK_DriverAssitant tools安装 53 | 54 | 此时不需要连上rockchip的设备。直接下载[RK_DriverAssitant](RK_DriverAssitant) 55 | 56 | 然后解压、打开.exe格式的文件 57 | 58 | 如下图,点击install Driver即可安装。如果你不能确定你之前是否曾经安装过,则先点击Uninstall Driver,再安装 59 | ![u](http://radxa.com/mw/images/b/ba/RK_Driver_Assistant_Install_Uninstall.jpg) 60 | 61 | 接着如下图所示,点击Install。由于Windows的版本不同,可能需要你进行两次这个操作。 62 | ![image](http://radxa.com/mw/images/e/e6/RK_Driver_Assistant_Windows_Security.jpg) 63 | 64 | 然后可以启动你的设备了。 65 | 66 | **Windows XP在操作上有一些不一样,你需要参考压缩包中的readme,然后进行操作。** 67 | 68 | ##### 2.手动安装驱动 69 | 70 | 下载驱动(http://dl.radxa.com/rock/tools/windows/radxa_adb_driver.zip ),然后解压开。 71 | 72 | 启动你的rock,并且连接上电脑 73 | 74 | 当系统提示“找到新设备”的时候,根据提示找到驱动位置,系统会完成安装 75 | 76 | ### 安装android SDK 77 | 78 | * 在Windows下安装adb,通常的做法是安装有google公司提供的android SDK。而SDK的管理需要JDK的支持。所以下载[JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html),并把它安装好。 79 | 80 | * 然后下载[SDK](http://dl.google.com/android/android-sdk_r22.3-windows.zip),并把它解压到C盘下,像这样 C:\android-sdk-windows。 81 | 82 | * 安装SDK时,首先选“Android SDK tools" ,然后是”Android sdk platform",接着是“install packages",sdk就会被下载,被安装到"C:\android-sdk-windows\platform-tools" 83 | 84 | ### 设置环境 85 | 86 | * 右键”我的电脑“ 87 | 88 | ### 设置USB ID 89 | 90 | * 打开windows的终端cmd,输入以下命令 91 | `cd c:\android-sdk-windows` **此处是你的安装目录** 92 | `mkdir .android` 93 | 94 | * 进入我们刚刚创建的文件夹下,创建一个新的文件,名字为“adb_usb.ini",然后打开它,在里面输入以下内容,然后保存 95 | > 0x2207 96 | 97 | * 然后开始测试adb 98 | `cd c:\android-sdk-windows\platform-tools` 99 | `adb kill-server` 100 | `adb devices` 101 | 102 | 然后你应该会看到类似下面的信息 103 | > List of devices attached 104 | 16EM8P26M8 device 105 | 106 | 完成! 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /_posts/android/2015-07-20-android-dev-tips.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: android开发的一些小技巧 4 | category: Android 5 | tags: [android] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | # android开发小技巧 11 | 12 | 本文将介绍一些rock android开发的小技巧。 13 | 14 | ### 备份android的APP应用 15 | 16 | 有时我们需要频繁的更换系统固件,但是安装在系统上的app又是必要的,待会又要重新安装。这时候你可以使用adb工具来节省一点时间。 17 | 18 | * 首先,你需要先安装adb。如果你之前没安装,可以参考http://radxa.com/Rock/linux_adb(linux). 19 | 或者http://radxa.com/Rock/windows_adb(windows). 20 | 21 | * 然后连接上设备后,使用如下命令备份 22 | `adb backup -apk -shared -all` 23 | 24 | * 当回复备份的时候,则使用以下命令 25 | `adb restore backup.ab` 26 | 27 | ### adb主机中,对android设备进行截图 28 | 29 | 只需要执行以下命令就可以 30 | 31 | adb shell "cat /dev/graphics/fb0 > /sdcard/fb.raw"` 32 | adb pull /sdcard/fb.raw` 33 | ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 1920x1080 -i fb.raw -f image2 -vcodec png fb-%d.png 34 | 35 | 36 | 37 | 38 | 39 | - 40 | -------------------------------------------------------------------------------- /_posts/android/2015-07-22-adb-trouble-shooting.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: ADB连接不上怎么办 4 | category: Android 5 | tags: [android,adb] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | 11 | 12 | 很多人遇到这样的情况,android 起来之后,连接上数据线, 然后在命令提示符下运行adb命令 adb shell,adb kill-server. adb devices. 但是发现 device not found 或者 devices list 为空。 这种情况如何解决。 13 | 14 | 15 | 1、首先要确认是否正确安装了 官方提供的adb驱动。虽然官方提供的驱动是基于google提供的驱动改的,但是有一些针对自己产品的改动。请确认是使用官方驱动。下载地址:http://dl.radxa.com/rock/tools/windows/radxa_adb_driver.zip 16 | 17 | 2、使用官方提供的adb工具,下载地址:http://dl.radxa.com/rock/tools/windows/adb_tools.zip。你可以到这个目录下执行adb命令。如果不常用rock调试,不建议把这个adb 目录放到环境变量里面,防止与其他android设备冲突。 18 | 19 | 3、如果1,2 步完成后,执行adb命令没有反应。看是否自己的PC的USB接口是否是USB3.0, 目前rock 对USB3.0兼容性不好,请用USB2.0 连接。如果还是不行,重启(只限于第一次安装驱动的时候重启,之后不需要)后再尝试 20 | 21 | 4、前3步确认没有问题,依然无法连接,执行adb kill-server,或者调出任务管理器 干掉所有的adb进程。再尝试。 22 | 23 | 5、前4个步骤确认后还存在问题,更换USB数据线后继续尝试。 24 | 25 | 一般来说。 是adb驱动和adb工具使用不对造成的。 26 | 27 | 很多人说可以使用手机助手来解决这个问题,但是发现adb连接时好时坏,或者一旦退出手机助手 adb用不了等问题。 28 | 29 | 这些基本都是由于adb驱动或者工具冲突导致的。 30 | 31 | 按照上面的步骤一步步执行。应该是没有问题的。 32 | 33 | 如果还不行,请提出。 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /_posts/driver/2014-12-31-radxa-display-setting.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 关于显示 4 | category: 硬件操作 5 | tags: [显示, display, 分辨率, 资源] 6 | keywords: redxa,rock,display 7 | description: 8 | --- 9 | 10 | ##关于显示 11 | 12 | Radxa Rock- RK3188有两个LCD控制器,LCD0和LCD1。在RR上,LCD1连接HDMI,LCD0连接AV输出,LCD0的信号也可以在扩展口上输出。 13 | 14 | 有一些sysfs接口会输出控制显示相关的东西。**下面代码应该可以在Android和Linux都运行很好** 15 | 16 | ## 设置显示比例 17 | 18 | 设置一个变量,方便操作 19 | 20 | root@radxa:# export SCALE=/sys/class/graphics/fb0/scale 21 | 22 | 对于新的Ubuntu系统,你需要使用下面的名面替代上面那条 23 | 24 | root@radxa:# export SCALE=/sys/class/display/HDMI/scale 25 | 26 | 查看当前的设置 27 | root@radxa:# cat $SCALE 28 | xscale=95 yscale=95 29 | 30 | 改变设置 31 | root@radxa:# echo 100 > $SCALE 32 | root@radxa:# cat $SCALE 33 | xscale=100 yscale=100 34 | 35 | 36 | 你也可以为X和Y设置不同的比例: 37 | 38 | root@radxa:# echo xscale=80 > $SCALE 39 | root@radxa:# echo yscale=100 > $SCALE 40 | root@radxa:# cat $SCALE 41 | xscale=80 yscale=100 42 | 43 | 44 | ## 设置HDMI输出模式 45 | 46 | 你可以输入下面的命令来查看支持的输出模式: 47 | 48 | ``` 49 | root@radxa:# cat /sys/class/display/display0.HDMI/modes 50 | #For the new Ubuntu 14.04 image, the path is changed to 51 | root@radxa:# cat /sys/class/display/HDMI/modes 52 | 1920x1080p-60 53 | 1920x1080p-50 54 | 1280x720p-60 55 | 1280x720p-50 56 | 720x576p-50 57 | 720x480p-60 58 | ``` 59 | 60 | 查看当前的显示模式: 61 | 62 | ``` 63 | root@radxa:# cat /sys/class/display/display0.HDMI/mode 64 | #For the new Ubuntu 14.04 image, the path is changed to 65 | root@radxa:# cat /sys/class/display/HDMI/mode 66 | 1280x720p-60 67 | ``` 68 | 69 | 说明当前处于720p@60HZ。改变为1080p@60HZ模式: 70 | 71 | ``` 72 | root@radxa:# echo 1920x1080p-60 > /sys/class/display/display0.HDMI/mode 73 | #For the new Ubuntu 14.04 image, the path is changed to 74 | root@radxa:# echo 1920x1080p-60 > /sys/class/display/HDMI/mode 75 | ``` 76 | 77 | ## 设置X和终端的字体大小 78 | 79 | 改变DPI来增大X的字体大小 80 | 81 | ``` 82 | rock@radxa:~$ sudo nano ~/.Xresources 83 | ``` 84 | 85 | 增加下面的内容: 86 | 87 | ``` 88 | ! Xft settings 89 | Xft.dpi: 120 90 | Xft.antialias: true 91 | Xft.rgba: rgb 92 | Xft.hinting: true 93 | Xft.hintstyle: hintslight 94 | ``` 95 | 96 | 改变终端的设置: 97 | 98 | ``` 99 | rock@radxa:~$ sudo dpkg-reconfigure console-setup 100 | ``` 101 | 102 | 然后一步一步往下:回车,回车,选择字体,然后回车,回车,选择大小,然后回车。 103 | 104 | 按ctrl+alt+f1切换终端,然后验证你的设置: 105 | 106 | ``` 107 | root@radxa:~# setupcon 108 | ``` 109 | 110 | 你可以重新设置终端,知道找到最好的解决方案。。。 111 | 112 | ## 设置全彩色深度 113 | 114 | 为了在Radxa rock linux镜像上使用24/32全彩色深度: 115 | 116 | ``` 117 | apt-get install fbset 118 | ``` 119 | 120 | ``` 121 | cat <> /etc/init/fbset.conf 122 | # fbset - run fbset to set truecolor fbmode 123 | description "run fbset ASAP" 124 | start on startup and started udev or starting lightdm 125 | task 126 | script 127 | echo 0 > /sys/class/display/HDMI/enable 128 | [ -x /bin/fbset ] && /bin/fbset -a -nonstd 1 -depth 32 -rgba "8/0,8/8,8/16,8/24" 129 | echo 1 > /sys/class/display/HDMI/enable 130 | end script 131 | eof 132 | ``` 133 | 134 | ``` 135 | cat <> /etc/X11/xorg.conf 136 | Section "Screen" 137 | Identifier "Default Screen" 138 | DefaultDepth 24 139 | EndSection 140 | eof 141 | ``` 142 | 143 | 在重启之后,你应该不会看到绿色或者紫色的屏幕了。如果你看到了,说明出了些问题。你可以使用串口终端或者另一台电脑的SSH手动提交下面的命令: 144 | 145 | ``` 146 | service lightdm stop 147 | fbset -a -nonstd 1 -depth 32 -rgba 8/0,8/8,8/16,8/24 148 | service lightdm start 149 | ``` 150 | 151 | 为了让这个改变成为永久的,在启动时的时序是很严格的。fbset需要在X/lightdm启动之前被调用。在Linaro/Ubuntu上,需要一个upstart脚本:fbset.conf。"startup and started udev"的机制会尝试尽早的启动fbset。在我的rk3188上,这是可靠的,但是如果你有问题,你最好祈求修补“start on”机制。不要使用/etc/rc.local,因为这个脚本在lightdm启动(已经被upstart启动之后)后很久才启动。 152 | 153 | ## 设置帧缓冲分辨率 154 | 155 | 设置帧缓冲分辨率为720*480像素: 156 | 157 | ``` 158 | service lightdm stop 159 | fbset -a -xres 720 -yres 480 -vxres 720 -vyres 480 160 | service lightdm start 161 | ``` 162 | 163 | 如果你得到一个空白的屏幕,尝试重新激活屏幕: 164 | 165 | ``` 166 | echo 1 > /sys/class/graphics/fb0/enable 167 | ``` 168 | 169 | 一些其他分辨率设置的例子: 170 | 171 | ``` 172 | fbset -a -xres 720 -yres 576 -vxres 720 -vyres 576 173 | fbset -a -xres 1024 -yres 600 -vxres 1024 -vyres 600 174 | fbset -a -xres 1280 -yres 720 -vxres 1280 -vyres 720 175 | fbset -a -xres 1920 -yres 1080 -vxres 1920 -vyres 1080 176 | ``` 177 | 178 | -------------------------------------------------------------------------------- /_posts/driver/2015-01-06-control-led-with-gpio.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 通过 GPIO 控制 Radxa 的 LED 4 | category: 硬件操作 5 | tags: [GPIO] 6 | keywords: GPIIO 7 | description: 8 | --- 9 | 10 | 在 Radxa Rock 官方的配置说明中,Radxa 板子上带了三个可编程控制的 LED 指示灯,正式版中分别为红、绿、蓝三个,并依次排列在电源开关附近。在启动默认的 android 系统的时候,也会亮起蓝色的指示灯。那要如何在 Linux 下控制这些 LED 呢? 11 | 12 | 首先来看 Radxa 官方的 Wiki 给出的一段演示脚本,用于控制绿色 LED 闪烁: 13 | 14 | ``` 15 | #!/bin/sh 16 | 17 | # enable the gpio 172 -> green led 18 | echo 172 > /sys/class/gpio/export 19 | 20 | # set the direction to output 21 | echo "out" > /sys/class/gpio/gpio172/direction 22 | while true; 23 | do 24 | echo 0 > /sys/class/gpio/gpio172/value #led on 25 | sleep 1 26 | echo 1 > /sys/class/gpio/gpio172/value #led off 27 | sleep 1 28 | done 29 | 30 | ``` 31 | 32 | 从这个演示程序中可以看到 Radxa 的这个 LED 直接连接在了 GPIO 上,利用 Linux 系统下 /sys/class/gpio 这个文件接口进行操作就可以实现简单的控制功能。当然,如果有比较高级的需求的话,建议还是需要编写相关的驱动程序来操作 GPIO,不过这回就先不折腾驱动程序这部分了。 33 | 34 | 其实 LED 的控制非常简单,只需要控制对应的 GPIO 管脚电平高低即可控制其发光状态。为了控制这些管脚,需要了解的最主要信息无非就是 LED 对应的控制引脚编号。由于官方已经给出了这部分的设计图 http://dl.radxa.com/rock/docs/hw/RADXA_ROCK_schematic_20131025.pdf,所以要确定 LED 的控制引脚并不困难。 35 | 36 | ![image](https://blog.huhamhire.com/wp-content/uploads/2014/02/rk_led_gpio.png) 37 | 38 | 从设计图中,可以比较容易的找到,这些信息。绿色的 LED 连接在了 GPIO0_B4 位置,蓝色 LED 连接在了 GPIO0_B6,而红色的则由 GPIO0_B7 来控制。接下来就需要计算这些引脚在 Linux 系统下对应的编号,首先需要参考到 rk3188 内核源代码中关于 GPIO 这部分的头文件,https://github.com/Galland/Linux3188/blob/master/arch/arm/mach-rk30/include/mach/gpio.h。 39 | 40 | ![image](https://blog.huhamhire.com/wp-content/uploads/2014/02/rk_led_pin.png) 41 | 42 | 同样,可以很容易的找到这几个引脚的定义,以及它们编号的计算公式,然后只需要将 PIN_BASE = 160 以及 NUM_GROUP = 32 代入计算即可得出相应的引脚编号,这部分数据可以参考 http://hwswbits.blogspot.com/2013/10/bitbanging-radxa-rock-gpios.html。 43 | 44 | 简单的计算后,可以得出绿色、蓝色、红色 LED 的引脚编号分别为 172、174 以及 175。然后只需要写一个脚本就可以实现一些简单的控制,比如下面我就可以通过一个简单的脚本实现开机后自动熄灭红色 LED,并亮起绿色 LED 的功能。 45 | 46 | 首先创建脚本控制 LED 的脚本: 47 | 48 | ``` 49 | sudo vim /usr/local/bin/power-led-on.sh 50 | ``` 51 | 52 | 写入下面的内容: 53 | 54 | ``` 55 | #!/bin/bash 56 | 57 | for LED_IO in 172 175 58 | do 59 | echo $LED_IO > /sys/class/gpio/export 60 | echo "out" > /sys/class/gpio/gpio$LED_IO/direction 61 | echo 0 > /sys/class/gpio/gpio$LED_IO/value 62 | echo $LED_IO > /sys/class/gpio/unexport 63 | done 64 | ``` 65 | 66 | 这里需要说明的是,由于连接线路上的不同,蓝绿 LED 与红色 LED 在发光控制的数值参数上正好相反。 67 | 68 | ![rk_led_gb](https://blog.huhamhire.com/wp-content/uploads/2014/02/rk_led_gb.png) 69 | ![ 70 | rk_led_red](https://blog.huhamhire.com/wp-content/uploads/2014/02/rk_led_red.png) 71 | 72 | 蓝绿 LED 使用 0 输出控制点亮,1 控制熄灭;而红色 LED 则使用 1 控制点亮,0 控制熄灭。因而这里的操作就可以很方便的写在同一段循环体内。 73 | 74 | 接下来,为脚本文件赋予执行权限: 75 | 76 | ``` 77 | sudo chmod +x /usr/local/bin/power-led-on.sh 78 | ``` 79 | 80 | 然后编辑系统启动时的相关操作: 81 | 82 | ``` 83 | sudo vim rootfs/etc/rc.local 84 | ``` 85 | 86 | 在 exit 0 之前添加以下内容: 87 | 88 | ``` 89 | /usr/local/bin/power-led-on.sh 90 | ``` 91 | 92 | 在做完上面的这些设置以后,重启 Radxa 后,就可以看到板子上会亮起绿色 LED,并且红色 LED 熄灭。 93 | 94 | 参考: 95 | 96 | 1. https://blog.huhamhire.com/viewpost-1109.html 97 | -------------------------------------------------------------------------------- /_posts/driver/2015-05-17-custom-HDMI-resolution.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: HDMI分辨率调整 4 | category: 硬件操作 5 | tags: [HDMI] 6 | keywords: HDMI 7 | description: 如何调整HDMI分辨率? 8 | --- 9 | 10 | 说明: 11 | 12 | 1)目前这种方法适用于rock2 square, rock pro 和 rock lite 13 | 14 | 2)方法适用于Android 和 rabian 15 | 16 | 第一步:获取显示器的edid参数 (目前只找到windows下的工具) 17 | 18 | 下载工具 19 | http://dl.radxa.com/users/yao/sm_setup.exe 20 | http://dl.radxa.com/users/yao/Phoenix.zip 21 | 22 | 操作步骤 23 | 使用SoftMCCS 软件,打开之后,软件界面如下 24 | 25 | ![此处输入图片的描述][1] 26 | 27 | 1、打开 sm_setup.exe 软件 28 | 29 | 2、如果接了多台显示器,则在左上角栏中选择读取EDID的显示器型号,如"DELL E198WFP" 30 | 31 | 3、点击左上角“File -> Save EDID as”,将EDID信息保存在自己想要的位置,文件名可以自己指定,文件类型要选择“Raylar EDID file (*.dat)” 32 | 用文本编辑工具(如写字板)打开刚刚保存的EDID文件,如下图 33 | 34 | ![此处输入图片的描述][2] 35 | 36 | 第二步: 分析edid数据,得到相关参数 37 | 刚才我们已经通过“SoftMCCS”软件获取了EDID数据文件,下面要介绍另一个软件来分析这个数据,“Phoenix EDID Designer”(Phoenix.zip)。软件只有一个exe文件,不需要安装。点击打开按钮,然后找到并打开我们刚刚保存的EDID文件,打开后如下图: 38 | 39 | ![此处输入图片的描述][3] 40 | 41 | 选择 “Detailed Timings”(详细时序) 这一项 42 | 43 | ![此处输入图片的描述][4] 44 | 45 | 其中Timings 这一栏是我们需要的东西 46 | 从这个参数里面,我们可以得到显示器的 47 | pixclk是 106500000 48 | 默认分辨率是:1440 x 900 49 | 这个对应要修改的文件是 50 | drivers/video/rockchip/hdmi/hdmi-lcdc.c 51 | 52 | 其中: 53 | h_fp = H sync Offset = 80; h_pw = H sync width = 152; 54 | h_bp + h_fp + h_pw = H Brank = 464, 所以 h_bp = 464 - 152 - 80 = 232。v_fp, v_bp,v_pw 和 h_fp,h_bp,h_pw 是同样的原理。至于后面的参数,可以直接使用下面的值(暂时还没有仔细研究区别,简单测试是可以用的) 55 | 56 | ``` 57 | /* name refresh xres yres pixclock h_bp h_fp v_bp v_fp h_pw v_pw polariry PorI flag vic 2ndvic pixelrepeat interface */ 58 | 59 | { {"1440x900p@60Hz", 60, 1440, 900, 106500000, 232, 80, 5, 3, 152, 6, 0, 0, 0 }, 60 | 2, 0, 1, OUT_P888}, 61 | ``` 62 | 63 | 修改后clean,然后重新编译内核 64 | 65 | 第三步: 刷修改后编译出的固件,设置分辨率 66 | 67 | Rabian系统: 68 | 69 | 打开命令终端: menu->System Tools-> MATE Terminal 70 | 或者通过串口执行以下命令: 71 | 72 | ``` 73 | #cat /sys/class/display/display0.HDMI/modes 74 | 1920x1080p-60 75 | .. 76 | 1440x900p-60 77 | .. 78 | ``` 79 | 查看hdmi支持的分辨率. 80 | 81 | ``` 82 | #echo 1440x900p-60 > /sys/class/display/display0.HDMI/mode1440x900p-60 83 | 84 | ``` 85 | 86 | Android 系统: 87 | 88 | 设置->display->HDMI Mode 选择 1440x900p-60,此时的HDMI分辨率 已经变成 1440x900@60Hz. 89 | 90 | 91 | 以上内容在我们这边的显示器上测试成功。也有几个客户通过此方法修改ok,但不确定是否全部都行的通,有问题大家可以在此反馈。 92 | 93 | 遇到的问题: 94 | 95 | 1) 设置分辨率后发现,刷新频率和设置的不同,比如 1360x768@60Hz, pixclock =85500000,但是结果显示刷新频率只有46,这是什么情况? 96 | 97 | 这是由于你设置的pixclock,系统采用,系统根据你设置的clock找到一个更好的clock值,这个值你可以在kernel的log中看到,大致如下: 98 | 99 | ``` 100 | [ 119.205896] lcdc1: dclk:75000000>>fps:46 101 | ``` 102 | 103 | 为了达到60hz,你可以去调整 h_fp,h_bp,h_pw,v_fp,v_bp,v_pw的值(注意xres 和 yres不能改)。算法是(xres + h_fp + h_bp + h_pw) x (yres + v_fp + v_bp + v_pw) * fps = pixclock。其中fps 为刷新频率,比如 1360x768@60Hz 刷新频率就是60. 104 | 105 | 2) 把分辨率 和 频率都改对了,但是画面显示的时候有雪花,为何? 106 | 107 | 原因: 和 h_fp,h_bp,h_pw,v_fp,v_bp,v_pw值的设置有关,合理调整后看看效果。 108 | 109 | 3)无论如何修改,都没有变化,为何? 110 | 请看修改是否生效,建议make clean ,然后重新编译内核。 111 | 112 | 关于EDID 的详细内容,可以参考: 113 | 114 | - http://blog.csdn.net/wangpeiyao5566/article/details/45270773 115 | - http://blog.csdn.net/wangpeiyao5566/article/details/45269379 116 | 117 | 118 | [1]: http://images.cnitblog.com/blog/152134/201301/30191707-565197d17e30422bac82f602e100a98b.jpg 119 | [2]: http://images.cnitblog.com/blog/152134/201301/30191853-e703dd60a80546f79fdfa39f8a96d919.jpg 120 | [3]: http://images.cnitblog.com/blog/152134/201301/30192346-393776216326489c8e66f39234d086dd.jpg 121 | [4]: http://cn.radxa.com/data/attachment/forum/201504/29/113412ip45ya4b01ps1abn.png 122 | -------------------------------------------------------------------------------- /_posts/driver/2015-07-17-boot-process.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: nand、sdcard双启动 4 | category: 硬件操作 5 | tags: [双启动] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | 11 | # 启动流程 12 | 13 | ## NAND上面的双启动 14 | 15 | * 在NAND flash上用于双启动的boot镜像可以从下面的网址得到: 16 | http://dl.radxa.com/rock/images/dual_boot/ 17 | 18 | * 下载之后,按照 http://radxa.com/Rock/flash_the_image 烧写。 19 | 20 | ## 在SD卡、U盘/移动硬盘上的双启动 21 | 22 | 如果你想在SD卡、U盘/移动硬盘上进行双启动,那么按照下面的步骤: 23 | 24 | * 把整个Nand给Android使用 25 | 26 | * 使用SD卡/U盘/移动硬盘安装Lubuntu 27 | 28 | * 双启动 29 | 下面是存档的步骤: 30 | 31 | 从 http://dl.radxa.com/rock/images/android/ 下载纯净的android,并烧写 32 | 从SD卡或者 U盘或者移动硬盘 下载parameter文件,并烧写到 “parameter”分区。 33 | 从 http://dl.radxa.com/rock/images/ubuntu/partitions/ 下载最新的boot-linux.img,并烧写到 “recovery”分区。 34 | 从 http://dl.radxa.com/rock/images/ubuntu/partitions/ 下载最新的rootfs,烧写到SD卡/U盘/移动硬盘的“first partition” 35 | 从 http://dl.radxa.com/rock/images/android/BootUbuntu.apk 下载并安装用于从Android引导到linux的应用程序。 36 | 37 | 38 | 39 | 40 | - 41 | 42 | 43 | -------------------------------------------------------------------------------- /_posts/driver/2015-07-18-infrared-configuration.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 使用板子上的红外 4 | category: 硬件操作 5 | tags: [红外] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | # 使用板子上的红外 11 | 12 | ## 通过修改内核方式 13 | 14 | 目前的SDK提供的驱动只支持NEC编码格式的红外遥控器,下面介绍如何调试来支持不同品牌的遥控器。 15 | 16 | 只需要修改一个文件 "kernel/drivers/input/remotectl/rkxx_remotectl.c" 17 | 18 | 步骤如下: 19 | 20 | * 增加一个数组 21 | 22 | static struct rkxx_remote_key_table remote_key_table_41C8[] = { 23 | {0x38, KEY_VOLUMEUP}, 24 | {0xb8, KEY_VOLUMEDOWN}, 25 | {0x58, KEY_MENU}, 26 | {0xd0, KEY_REPLY}, 27 | {0x48, KEY_BACK}, 28 | {0x98, KEY_BACK}, 29 | {0x50, KEY_UP}, 30 | {0x30, KEY_DOWN}, 31 | {0xc8, KEY_LEFT}, 32 | {0xc0, KEY_RIGHT}, 33 | {0x40, KEY_REPLY}, 34 | {0x80, KEY_SEARCH}, 35 | }; 36 | 37 | 该数组将红外键值ircode映射为Linux标准键盘扫描码scancode 38 | 39 | 40 | * 增加一项,这里的每一项对应一种遥控器 41 | 42 | > static struct rkxx_remotectl_button remotectl_button[] 43 | For example: 44 | { 45 | .usercode = 0x41c8, /* 用户码 */ 46 | .nbuttons = 12, /* 按键个数 */ 47 | .key_table = &remote_key_table_41C8[0], /* 键盘表 */ 48 | } 49 | 50 | 第一个参数是用户码,每一种遥控器都有一个用户码用来和其他遥控器做区分.第二个参数对应遥控器的按键个数,第三个参数对应 步骤一增加的数组 51 | 52 | ## 如何获得用户码和遥控器键值 53 | 54 | 修改的地方在对应的函数 remotectl_do_something 中 55 | 56 | > case RMC_USERCODE: 57 | { 58 | ddata->scanData <<= 1; 59 | ddata->count ++; 60 | if ((TIME_BIT1_MIN < ddata->period) && (ddata->period < TIME_BIT1_MAX)){ 61 | ddata->scanData |= 0x01; 62 | } 63 | if (ddata->count == 0x10){//16 bit user code 64 | // printk("u=0x%x\n",((ddata->scanData)&0xFFFF)); 65 | if (remotectl_keybdNum_lookup(ddata)){ 66 | ddata->state = RMC_GETDATA; 67 | ddata->scanData = 0; 68 | ddata->count = 0; 69 | }else{ 70 | ddata->state = RMC_PRELOAD; 71 | } 72 | } 73 | } 74 | 75 | 放开注释的printk的代码,可以得到用户码,接下来在第二步 remotectl_button array我们添加的数组中填上对应的按键个数, 放开下面代码中的printk代码, 得到键值 76 | 77 | > case RMC_GETDATA: 78 | { 79 | ddata->count ++; 80 | ddata->scanData <<= 1; 81 | if ((TIME_BIT1_MIN < ddata->period) && (ddata->period < TIME_BIT1_MAX)){ 82 | ddata->scanData |= 0x01; 83 | } 84 | if (ddata->count == 0x10){ 85 | // printk(KERN_ERR "d=%x\n",(ddata->scanData&0xFFFF)); 86 | if ((ddata->scanData&0x0ff) == ((~ddata->scanData >> 8)&0x0ff)){ 87 | if (remotectl_keycode_lookup(ddata)){ 88 | ddata->press = 1; 89 | ... 90 | } 91 | ... 92 | } 93 | ... 94 | } 95 | } 96 | 97 | 注意: 98 | 99 | **从log中获得的键值是16进制的,前两位是我们需要的,后面的是前两位的反码,用于校验,直接忽略. 100 | 不要留太多的log,获得用户码和键值后把log关闭,否能可能导致遥控器无法使用** 101 | -------------------------------------------------------------------------------- /_posts/driver/2015-07-18-led-concrol.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 控制Radxa Rock上的LED灯 4 | category: 硬件操作 5 | tags: [产品] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # 控制Radxa Rock上的LED灯 11 | 12 | Radxa Rock上有三个LED灯 13 | * LED -- GPIOref -- GPIO number 14 | * 绿灯 -- GPIO0_B4 -- 172 15 | * 蓝灯 -- GPIO0_B6 -- 174 16 | * 红灯 -- GPIO0_B7 -- 175 17 | 18 | 我们可以控制他们通过/sys/class/leds下的文件 19 | 20 | 比如如下操作 21 | * 关闭红灯 `echo none > /sys/class/leds/red/trigger` 22 | * 常亮红灯 `echo default-on > /sys/class/leds/red/trigger` 23 | * 闪烁绿灯 `echo timer > /sys/class/leds/green/trigger` 24 | * 心跳蓝灯 `echo heartbeat > /sys/class/leds/blue/trigger` 25 | 26 | 你还可以常看tgigger文件,了解其他对LED灯的工作方式 27 | 28 | `cat /sys/class/leds/red/trigger` 29 | 30 | -------------------------------------------------------------------------------- /_posts/driver/2015-07-20-making-bootable-sdcard.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 制作可以启动rock的SD卡 4 | category: 硬件操作 5 | tags: [启动,SD卡] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | 11 | # 制作可以启动rock的SD卡 12 | 13 | 14 | 15 | * 下载工具,并借解压它http://dl.radxa.com/rock/tools/windows/SD_Firmware_Tool.zip 16 | * SD卡插入读卡器,读卡器连接到电脑上 17 | * 在广告下载的工具文件夹中,寻找一个“SD_Firewware_Tool.exe"的文件,然后打开它 18 | * 在”choose removable disk"项中,选择你广告插入的SD卡 19 | * 勾选"SD Boot" 20 | * 选择你想要烧录的镜像文件 21 | * 最后点击”create“按钮。当完成时,会有弹窗提示你。 22 | ![image](http://radxa.com/mw/images/b/bb/Boot_sdcard_1.jpg) 23 | 24 | 25 | 关闭rock设备 26 | 27 | 插入SD卡 28 | 29 | 重新启动rock就可以 30 | 31 | 32 | 33 | 34 | - 35 | -------------------------------------------------------------------------------- /_posts/driver/2015-07-20-using-camera-on-rock.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 使用rock上的无线设备 4 | category: 硬件操作 5 | tags: 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # 使用rock上的无线设备 11 | 12 | Radxa Rock提供了多种方式去连接,有线和无线。完整版有wifi和蓝牙功能,但是lite版只有wifi功能。所有的这些模块都通过USB接口与CPU连接。 13 | 14 | ## 使用Android下的无线设备 15 | 16 | android设备下的无限和蓝牙,只需要在设置中进行简单的设置即可使用。 17 | 18 | ## 使用linux下的无线设备 19 | 20 | #### wifi 21 | 22 | * rock 完整版上面的wifi模块为RTL8723AU,rock lite上面的wifi模块为RTL8188ETV.你可以使用下面的命令查看模块的信息 23 | `sudo apt-get install usbutils` 24 | `lsusb` 25 | 26 | * 完整版会输出类似如下信息 27 | > root@radxa:~# lsusb 28 | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 29 | Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 30 | Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB 31 | Bus 002 Device 003: ID 0bda:0724 Realtek Semiconductor Corp. 32 | 33 | * lite会输出类似下面信息 34 | > Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 35 | Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 36 | Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB 37 | Bus 002 Device 003: ID 0bda:0179 Realtek Semiconductor Corp. 38 | 39 | 0bda:0724 是rtl8723的ID, 0bda:0179 是rtl8188etv 的ID。 40 | 41 | ##### 桌面启动wifi 42 | 43 | > Go to Start menu -> Perference -> Network Connections -> wifi 44 | choose the wifi network you want to join and click edit -> wifi security 45 | input the wifi password and save. Then click the right corner to join your wifi network 46 | 47 | ##### 手动连接WIFI管理 48 | 49 | 你可以使用nmlci(命令行方式的网络管理工具)去配置你的网络 50 | 51 | * List wireless networks 52 | `nmcli dev wifi list` 53 | 54 | > SSID BSSID MODE FREQ RATE SIGNAL SECURITY ACTIVE 55 | 'MY-ACCESS-POINT' 12:34:56:78:90:AB Infrastructure 2412 MHz 44 MB/s 100 WPA WPA2 yes 56 | 'OTHER-ACCESS-POINT' 34:12:78:56:AB:90 Infrastructure 2416 MHz 54 MB/s 70 WPA WPA2 yes 57 | 58 | * 连接网络 59 | `nmcli dev wifi connect MY-ACCESS-POINT password MY-PASSWORD` 60 | 61 | * 网络设备列表 62 | `nmcli device` 63 | > DEVICE TYPE STATE 64 | wlan1 802-11-wireless connected 65 | eth0 802-3-ethernet unavailable 66 | 67 | ##### 手动连接配置你的无线路由 68 | 69 | * 使用lite连接你的无线路由器,你可以按照下面这样做 70 | 71 | `sudo apt-get install wireless-tools` 72 | `sudo apt-get install wpasupplicant` 73 | `sudo ifconfig wlan0 up` 74 | 75 | * 如果你不能够正常启用wlan0,意味着驱动没有被安装。你可以按照下列步骤去安装驱动。不过这是在rock连接上以太网的情况下。如果没有,你需要从其他地方下载,并且移动到rock的储存上。 76 | 77 | `sudo mkdir -p /lib/modules && cd /lib/modules` 78 | `sudo wget http://dl.radxa.com/rock/images/ubuntu/partitions/modules_3.0.36+_14-04-12.tar.gz` 79 | `sudo tar zxvf modules_3.0.36+_14-04-12.tar.gz` 80 | `sudo rm modules_3.0.36+_14-04-12.tar.gz` 81 | `sudo modprobe 8723au` 82 | 现在,你可以用ifconfig看到wlan0了。 83 | 84 | * 你可以看到wifi在扫描附近的热点工作了。 85 | `iwlist wlan0 scan` 86 | 87 | * 对于新的wifi驱动,iwlist会提示"wlan0 Interface doesn't support scanning",你需要去使用新的工具iw替代它 88 | `iw dev wlan0 scan` 89 | 90 | * 我们回到连接路由器的步骤上,编辑/etc/wpa_supplicant.conf 91 | 92 | > ctrl_interface=/var/run/wpa_supplicant 93 | network={ 94 | ssid="your ssid name" 95 | psk="your wireless password" 96 | } 97 | 98 | * 然后运行下面的命令去连接路由器 99 | `wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf ` 100 | 101 | 102 | * 运行下面的命令从路由得到IP 103 | `dhclient wlan0` 104 | 105 | * 假如你想要rock在每次启动的时候自动连接到无线网络,添加以下的文字到/etc/network/interfaces 106 | > auto wlan0 107 | iface wlan0 inet dhcp 108 | wpa-conf /etc/wpa_supplicant.conf 109 | 110 | -------------------------------------------------------------------------------- /_posts/driver/2015-12-02-oled-spi.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 通过Rock的SPI接口,控制oled灯的显示 4 | category: 硬件操作 5 | tags: [oled, spi] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | 11 | # 通过Rock的SPI接口,控制oled灯的显示 12 | ---------- 13 | 14 | 先上一个成品图,[完整代码](/public/codes/oled.tar.gz)。 15 | ![img](/public/img/spi_oled.jpg) 16 | 17 | ### 准备工作 18 | 19 | * 一块装有linux系统,并且拥有最新版本内核(包含spidev驱动)的ROCK开发板   20 | 最新内核可以到[这里](http://build.radxa.com/)下载boot-linux.img,烧录方式请参考[烧录](/2014/12/28/Flash-image-to-nand-linux.html) 21 | 22 | * 一个oled显示屏(我的例子中,使用的是SSD1306芯片驱动的128×64分辨率)   23 | 24 | * 若干连接线 25 | 26 | 27 | 28 | ### 连接方式 29 | 30 | 屏幕有7个接口,分别为 31 | 32 | + GND => 地线 33 | + VCC => 电源   34 | + D0 => 时钟   35 | + D1 => 数据   36 | + RES => 复位   37 | + DC => 命令/数据 转换位   38 | + CS => 片选  39 | 40 | ![pin](/public/img/oled.jpg) 41 | 42 | 下面这个是rock pro 的拓展口  43 | 44 | ![pro](http://radxa.com/mw/images/f/fb/Extension_header_funcb.png) 45 | 46 | 接线方式为 (不唯一) 47 | 48 | + GND => 接地即可(如, J8-17) 49 | + VCC => 可不接 50 | + D0 => J8-23(SPI1_CLK) 51 | + D1 => J8-28(SPI1_TX)  52 | + RES => J8-7(GPIO167)   53 | + DC => J8-9(GPIO169)   54 | + CS => J8-19(SPI1_CSN0) 55 | 56 | ### oled工作原理介绍 57 | 58 | OLED显示技术具有自发光的特性当有电流通过时,这些有机材料就会发光,而且OLED显示屏幕可视角度大,能够节省电能,以后在许多领域都会有应用。 59 | 60 | 当oled屏幕开启,单不显示的时候,跟关闭是一样的,没有一点光。 61 | 62 | CS, D0, D1, GND四个引脚不用我们多顾虑,通信的spi协议驱动已经在内核中写好,通过/dev/spidev1.0文件写入即可 63 | 64 | RES引脚用于把屏幕驱动芯片的所有设置清空,复位用的,接在GPIO169上 65 | 66 | DC引脚比较关键,当我们需要配置屏幕的一些参数时,此引脚需要处于低电平,需要写数据在屏幕显示时,需要处于高电平 67 | 68 | 69 | 70 | ### 代码结构 71 | 72 | 代码总共6个文件,一个显示脚本oled.sh,一个makefile,oledfont.h是存储了英文和数字的字库, mian.c是控制模块,oled.c才是驱动屏幕的内容。 73 | 74 | 说明代码前,对于不知道如何操作rock板gpio口的朋友,需要先看看这个[文章](/2015/01/06/control-led-with-gpio.html) 75 | 76 | 我截取了几个比较重要的函数说明一下. 77 | 78 | 79 | //传入一个数值,根据这个数据,初始化某个gpio 80 | int __initgpio( int pin){ 81 | while(1){ 82 | char valuepath[50] = {0, }; 83 | sprintf(valuepath, "/sys/class/gpio/gpio%d/value", pin); 84 | int fd3 = open(valuepath, O_WRONLY); //只读方式打开 85 | if(fd3 != -1){ 86 | return fd3; //如果该文件打开正确,表示已经初始化过,直接返回文件描述符即可 87 | } 88 | if( errno != 2){ 89 | perror("value open :"); 90 | exit(1); //如果错误码不为2,表示该文件存在,却因其他原因打不开,直接退出 91 | } 92 | //进去此处,表示该文件不存在,gpio需要初始化 93 | int fd = open("/sys/class/gpio/export", O_WRONLY); 94 | if(fd == -1){ 95 | perror("export open :"); 96 | return -1; 97 | } 98 | char gpio[10] = {0,}; 99 | sprintf(gpio, "%d", pin); 100 | if( write(fd, gpio, strlen(gpio)+1) == -1){ //往文件中写入pin值 101 | perror("export write :"); 102 | return -1; 103 | } 104 | //成功后,会在当前文件夹生成gpioxxx文件夹 105 | char direcpath[50] = {0, }; 106 | char *out = "out"; 107 | sprintf(direcpath, "/sys/class/gpio/gpio%d/direction", pin); 108 | int fd2 = open(direcpath, O_WRONLY); 109 | if(fd == -1){ 110 | perror("direction open :"); 111 | return -1; 112 | } 113 | if( write(fd2, out, strlen(out)+1) == -1){ 114 | perror("direction write :"); 115 | return -1; 116 | } 117 | } 118 | } 119 | 120 | 121 | void OLED_WR_Byte(u8 dat,u8 cmd) 122 | { 123 | u8 i; 124 | if(cmd) 125 | OLED_DC_Set(); //如果需要写入数据,DC高电平 126 | else 127 | OLED_DC_Clr(); //如果需要写入命令,DC低电平 128 | int ret = write(SPI, &dat, sizeof(dat)); 129 | if(ret == -1) 130 | perror("spi write :"); 131 | OLED_DC_Set(); 132 | } 133 | 134 | 这两个是比较核心的函数,其他函数大家看看代码,比较简单 135 | 136 | 137 | ### 控制脚本 138 | 139 | PIN="--DCgpio=166 --RESgpio=169" 140 | ./oled Hello,friends -i -b "$PIN" 141 | ./oled Hello,friends -r 1 -f -t 1000 "$PIN" 142 | ./oled I\`m\ Radxa -r 3 "$PIN" 143 | 144 | 需要显示的文字,可不带,如果带,必须为第一个参数 145 | 146 | * -i 第一次开启屏幕时,必须带上,初始化屏幕 147 | * -b 翻转屏幕 148 | * -f 刷新屏幕 149 | * -r 显示时的行数,默认居中 150 | * -t 延迟执行,单位为ms 151 | * DCgpio默认169, REgpio默认167, 不使用默认,需要每次显示指定 152 | * ... -------------------------------------------------------------------------------- /_posts/hardware/2014-12-29-differences-between-products.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: radxa系列产品的比较 4 | category: 硬件信息 5 | tags: [产品, 配置] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | >随着产品的发布和更新,radxa产品越来越多。看看它们的区别吧。 11 | 12 | 13 | ## radxa rock 、radxa rock lite和 radxa rock pro三者的区别 14 | 15 | 主要的区别是: 16 | 17 | 1. radxa rock pro(2014年中): 2GB ram, 8GB nand flash with lvds and camera interface 18 | 19 | 2. radxa rock lite(2014年中): 1GB ram, no nand flash(use uSD card for the OS), wifi only 20 | 21 | 3. radxa rock(2013): 2GB ram, 8GB nand flash, wifi and bluetooth 22 | 23 | 4. radxa rock lite(2013): 1GB ram, 4GB nand flash, wifi only 24 | 25 | 26 | 27 | 28 | ## Rock pro与Rock的区别: 29 | 30 | - 增加LVDS接口(FPC接口位于主板底部) 31 | 32 | - 增加触控面板接口 33 | 34 | - 增加连接摄像模块的CSI接口 35 | 36 | - 主板多了扬声器驱动电路 37 | 38 | - 其余和Rock保持一致 39 | 40 | 41 | ## Rock pro与Rock lite的区别: 42 | 43 | - lite内存减小了到1GB 44 | 45 | - lite除掉了蓝牙模块 46 | 47 | - lite除去了nand存储,统一使用SD卡 48 | 49 | -------------------------------------------------------------------------------- /_posts/hardware/2014-12-29-products.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: radxa产品及配件 4 | category: 硬件信息 5 | tags: [产品, 配置] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | >Radxa Rock是Radxa公司生产的基于RK3188的单板计算机(SBC,Single Board Computer)。它有**4核**的ARM处理器,可以运行一些Linux的发行版。它也有80个2.54mm的pin,这使得连接其他传感器或者使用GPIO变得非常简单。 10 | 11 | Radxa Rock支持Android 4.2.2(Jelly Bean)和Ubuntu/Linaro 13.09在NAND falsh(板上存储)上双启动。Rock Pro支持Android 4.4.2(Kitkat)在NAND flash上启动。 12 | 13 | 你可以[烧写](http://radxa.com/Rock/flash_the_image)最新的[Android镜像和各种Linux镜像](http://radxa.com/Rock/prebuilt_images),或者你可以尝试[从SD card启动](http://radxa.com/Rock/SD_images)Android/Linux。你可以[编译你自己的Android](http://radxa.com/Rock/Android_Build)、[编译自己的内核](http://radxa.com/Rock/Booting_Linux)、[编译自己的Ubuntu 根文件系统](http://radxa.com/Rock/ubuntu),或者做你喜欢的其他事情。 14 | 15 | ### 随板配件 16 | 17 | - radxa rock 开发板 18 | - USB转直流电源线 19 | - WiFi 天线 20 | - 你可以买 Full Transparent Case来更好的保护开发板。 21 | 22 | 你也可以需要下面的基础外设让Radxa工作: 23 | 24 | - 带有A类型USB的电源适配器,至少5V/2A(这点很重要) 25 | - TV显示器(接口为HDMI或者AV) 26 | - HDMI或者AV线 27 | - 网线或者使用WiFi 28 | - USB键盘/鼠标或者USB无线空鼠 29 | - 红外IR遥控器 30 | 31 | 如果你有下面这些那就更好了: 32 | 33 | - micro USB线 34 | - 串口TTL转USB线 35 | 36 | 当一切准备妥当,它和下面的样子就差不多了 37 | 38 | ![radxa的样子](http://radxa.com/mw/images/6/6f/Hookup.png) 39 | 40 | ### 开机 41 | 42 | 将直流转USB线连接上USB电源,另一端插入开发板的DC直流接口。电源键下面的红色指示灯应该亮起,同时HDMI应该输出radxa的启动logo动画。等一会绿色或者蓝色指示灯会亮起。 43 | 44 | 45 | 参考: 46 | 47 | 1. http://radxa.com/Rock/Getting_Started 48 | 49 | -------------------------------------------------------------------------------- /_posts/hardware/2014-12-31-Radxa-Rock-Lite-docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Radxa Rock Lite的详细介绍 4 | category: 硬件信息 5 | tags: [rock,radxa,lite] 6 | keywords: redxa,rock,lite 7 | description: 8 | --- 9 | 10 | ## 产品简介 11 | 12 | Radxa Rock Lite是一款基于ARM Cortex-A9构架的开源四核开发板,搭载了国内首款采用28nm工艺瑞芯微RK3188芯片,主频最高达到1.6Ghz,比主流的32nm工艺三星Exynos 4412处理器,还有40nm工艺的Tegra3功耗更低,官方宣称运算速度比Cortex-A7提升35%。 13 | 14 | 拥有1G内存、板载wifi\RTC,外围接口丰富,新增LVDS 接口,触摸屏接口,camera 摄像头接口,板载扬声器驱动电路,板载80扩展PIN,支持GPIO, I2C, SPI, Line in, USB 2.0, PWM, ADC, LCD, GPS等,性价比超高,是一款理想的diy开发板。 15 | 16 | ## 产品配置 17 | 18 | - 处理器:ARM Cortex-A9,四核RK3188处理器 19 | - 支持wifi 20 | - HDMI输出接口,1080p@60Hz 21 | - 自带两个2.0 USB和一个OTG接口 22 | - 1G-DDR3内存 23 | - 支持RTC ,TF卡 24 | - 支持Linux、Andriod、FreeBSD系统 25 | 26 | ## 硬件清单 27 | 1. Radxa Rock Lite开发板*1 28 | 2. 电源线*1 29 | 3. 可拆卸wifi天线*1 30 | 4. 亚克力外壳*1 31 | 5. 环保外包装*1 32 | 33 | 34 | ## 配件选购 35 | 36 | 1. 5V 2A电源(RADXA在负荷量较大的情况下,需要5V2A才能正常工作) 37 | 2. USB to TTL串口调试线 38 | 3. 双头HDMI显示高清线 39 | 4. 音频视频AV连接线 40 | 5. Mirco USB刷机线 41 | 6. 11键IR遥控器 42 | 7. HDMI转VGA转接头 43 | 8. 带风扇散热器 44 | 45 | 46 | 淘宝链接:http://item.taobao.com/item.htm?spm=a230r.1.14.26.SYY7DZ&id=41040766536&ns=1#detail 47 | 48 | ## Rock lite 直接从SD卡启动, 49 | 50 | - android 固件下载地址: 51 | http://dl.radxa.com/rock_lite/images/android/ 52 | 53 | - linux 固件下载地址: 54 | http://dl.radxa.com/rock_lite/images/linux/ 55 | 56 | 或者到http://pan.baidu.com/s/1kTKFzYB 的 rock_lite目录下载 57 | 58 | 刷机方式 请参考目录或者压缩包中的readme文档 59 | 60 | 如果下载速度较慢,可以使用迅雷下载 61 | 62 | 源码下载:Rock Lite 和 Rock Pro 用的是同一份代码,位于百度云盘 rock_pro目录下的source目录下。 63 | 64 | 如有疑问请加: radxa 讨论群 339567728或者邮件到support@radxa.com 65 | 66 | - 如何编译android固件请参考: 67 | 68 | http://radxa.com/Rock/Android_Build 69 | 70 | - 如何制作SD卡启动盘请参考: 71 | 72 | http://dl.radxa.com/rock_lite/images/android/ 下面的readme文档 73 | 74 | -------------------------------------------------------------------------------- /_posts/hardware/2015-01-01-Radxa-Rock-Pro-Specification.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Radxa Rock Pro的硬件配置 4 | category: 硬件信息 5 | tags: [产品, 配置] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | # 揭开Radxa Rock Pro的面纱 11 | 12 | 13 | - 处理器:ARM CORTEX-A9 QUAD CORE @1.6GHZ 14 | - 图像处理器:MAIL400-MP4@533MHZ,OPENGL ES 2.0 15 | - RAM:2GB DDR3,800MHZ 16 | - 内存:8GB FLASH 17 | - 视频输出 18 | - 数字输出:HDMI1.4,最大支持1080P 19 | - 模拟输出:AV端口输出 20 | - 音频输出: 21 | - 3.5MM 音频口 22 | - S/PDIF 23 | - 调试:支持串口调试 24 | - 电源输入:5V DC接口 25 | - USB: 26 | - 两个USB 2.0 HOST,TYPE A 27 | - 一个USB OTG,miro USB接口 28 | - 串口:板载有串口引脚 29 | - 以太网支持:10/100M bit/s RJ45接口 30 | - SD/MMC卡:可外接micro SD卡,最大支持128G内存卡 31 | - 按键输入:一个电源键,一个复位键,一个恢复键 32 | - LED灯:三个可编程的LED灯 33 | - 实时时钟:板载有实时时钟 34 | - 红外:一个红外接收器 35 | - 扩展:共有80个pins 36 | - 支持GPIO,I2C,SPI,line in,USB2.0 ,PWM,ADC,LCD,GPS等 37 | - 重量:61克(仅主板) 38 | - 尺寸:100*80 MM 39 | - 系统:支持Linux、Andriod、FreeBSD系统,默认搭载Android4.2.2 40 | 41 | -------------------------------------------------------------------------------- /_posts/hardware/2015-01-05-extension-header.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Radxa Rock(pro/lite)的扩展接口 4 | category: 硬件信息 5 | tags: [产品, 接口] 6 | keywords: 接口,配置 7 | description: 8 | --- 9 | 10 | Radxa Rock(pro/lite)有两个2.54mm 40引脚(20*2)的板载扩展接口,包括GPIO,I2C,SPI,Line in,USB 2.0,PWM,ADC,LCD等接口。你可以很容易地将面包板或者其他传感器板卡连接到rock。所有的rock/rock pro/rock lite都是兼容的。 11 | 12 | ## 只用作GPIO的扩展接口 13 | 14 | ![image](http://radxa.com/mw/images/8/87/Extension_header_funca.png) 15 | 16 | ## 扩展接口的其他功能 17 | 18 | ![image](http://radxa.com/mw/images/f/fb/Extension_header_funcb.png) 19 | 20 | ## 全部的功能表 21 | 22 | 见http://radxa.com/Rock/extension_header 23 | 24 | ## FPC扩展接口 25 | 26 | Rock Pro and Lite(2014 Mid)在板子后面有三个FPC接口。 27 | 28 | -------------------------------------------------------------------------------- /_posts/hardware/2015-07-21-product-history.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 硬件版本信息 4 | category: 硬件信息 5 | tags: [产品] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # 2013.08.12 值得记住的日子 11 | 12 | 第一块radxa rock样板也叫radxa rock工程板,只生产了100片。几乎所有的东西都运行良好。但是还是有一些小问题: 13 | 14 | - HDMI接口太靠近SPDIF 插孔,可能会与一些大头的HDMI线冲突 15 | - UART可以被一些5V TTL转USB损坏(警告:请务必使用3.3V TTL转USB线) 16 | - 复位键可以作为POWER halt功能,重启板子需要按重启键然后按电源键。 17 | 18 | ![](http://radxa.com/mw/images/thumb/a/ad/Rock_es_front.png/1000px-Rock_es_front.png) 19 | 20 | = 21 | 22 | = 23 | 24 | 25 | # 这是Radxa Rock的第一个MP版本。 26 | 27 | 这个版本修复了所有在2013.08.12版本已知的问题。因为HDMI接口的的位置移动了一点,这个版本的例子无法用在之前的版本上,除了一些简单的例子。软件和之前的版本是一样的。 28 | 29 | 30 | 31 | ## 电路方面的改变 32 | 33 | ## PCB方面的改变 34 | 35 | ![image](http://radxa.com/mw/images/4/47/Rock_front.jpg) 36 | 37 | ![image](http://radxa.com/mw/images/7/71/Rock_back.jpg) 38 | 39 | 40 | = 41 | 42 | = 43 | 44 | # 2014-06-10,Rock Pro 发布 45 | 这个一款新的硬件版本,满足了社区的要求。 46 | 47 | ### 主要的改变是: 48 | 49 | - 增加LVDS接口(FPC接口位于主板底部) 50 | 51 | - 增加触控面板接口 52 | 53 | - 增加连接摄像模块的CSI接口 54 | 55 | - 主板多了扬声器驱动电路 56 | - 没有Nand,1G DDR 57 | 58 | ### 详情 59 | 60 | 61 | - 处理器:ARM CORTEX-A9 QUAD CORE @1.6GHZ 62 | - 图像处理器:MAIL400-MP4@533MHZ,OPENGL ES 2.0 63 | - RAM:2GB DDR3,800MHZ 64 | - 内存:8GB FLASH 65 | - 视频输出 66 | - 数字输出:HDMI1.4,最大支持1080P 67 | - 模拟输出:AV端口输出 68 | - 音频输出: 69 | - 3.5MM 音频口 70 | - S/PDIF 71 | - 调试:支持串口调试 72 | - 电源输入:5V DC接口 73 | - USB: 74 | - 两个USB 2.0 HOST,TYPE A 75 | - 一个USB OTG,miro USB接口 76 | - 串口:板载有串口引脚 77 | - 以太网支持:10/100M bit/s RJ45接口 78 | - SD/MMC卡:可外接micro SD卡,最大支持128G内存卡 79 | - 按键输入:一个电源键,一个复位键,一个恢复键 80 | - LED灯:三个可编程的LED灯 81 | - 实时时钟:板载有实时时钟 82 | - 红外:一个红外接收器 83 | - 扩展:共有80个pins 84 | - 支持GPIO,I2C,SPI,line in,USB2.0 ,PWM,ADC,LCD,GPS等 85 | - 重量:61克(仅主板) 86 | - 尺寸:100*80 MM 87 | - 系统:支持Linux、Andriod、FreeBSD系统,默认搭载Android4.2.2 88 | 89 | 90 | 91 | ![image](http://radxa.com/mw/images/7/74/Rock_lite.jpg) 92 | 93 | ![image](http://radxa.com/mw/images/0/04/Rock_lite_back.jpg) 94 | 95 | 参考: 96 | 97 | 1. http://radxa.com/Rock/hardware_revision 98 | 99 | = 100 | 101 | = 102 | 103 | # 2014-06-10,Rock lite 发布 104 | 105 | 这个一款新的硬件版本,满足了社区的要求。 106 | 107 | ### 主要的改变是: 108 | 109 | - 增加LVDS接口(FPC接口位于主板底部) 110 | 111 | - 增加触控面板接口 112 | 113 | - 增加连接摄像模块的CSI接口 114 | 115 | - 主板多了扬声器驱动电路 116 | - 没有Nand,1G DDR 117 | 118 | ![image](http://radxa.com/mw/images/7/74/Rock_lite.jpg) 119 | 120 | ![image](http://radxa.com/mw/images/0/04/Rock_lite_back.jpg) 121 | 122 | ### 详情 123 | 124 | Radxa Rock Lite是一款基于ARM Cortex- 125 | 126 | A9构架的开源四核开发板,搭载了国内首款采用28nm工艺瑞芯微RK3188芯片,主频最高达到1.6Ghz,比主流的32nm工艺三星Exynos 4412处理器,还有40nm工艺的Tegra3功耗更低,官方宣称运算速度比Cortex-A7提升35%。 127 | 128 | 拥有1G内存、板载wifi\RTC,外围接口丰富,新增LVDS 接口,触摸屏接口,camera 摄像头接口,板载扬声器驱动电路,板载80扩展PIN,支持GPIO, I2C, SPI, Line in, USB 2.0, PWM, ADC, LCD, GPS等,性价比超高,是一款理想的diy开发板。 129 | 130 | ## 产品配置 131 | 132 | - 处理器:ARM Cortex-A9,四核RK3188处理器 133 | - 支持wifi 134 | - HDMI输出接口,1080p@60Hz 135 | - 自带两个2.0 USB和一个OTG接口 136 | - 1G-DDR3内存 137 | - 支持RTC ,TF卡 138 | - 支持Linux、Andriod、FreeBSD系统 139 | 140 | ## 硬件清单 141 | 1. Radxa Rock Lite开发板*1 142 | 2. 电源线*1 143 | 3. 可拆卸wifi天线*1 144 | 4. 亚克力外壳*1 145 | 5. 环保外包装*1 146 | 147 | 148 | ## 配件选购 149 | 150 | 1. 5V 2A电源(RADXA在负荷量较大的情况下,需要5V2A才能正常工作) 151 | 2. USB to TTL串口调试线 152 | 3. 双头HDMI显示高清线 153 | 4. 音频视频AV连接线 154 | 5. Mirco USB刷机线 155 | 6. 11键IR遥控器 156 | 7. HDMI转VGA转接头 157 | 8. 带风扇散热器 158 | 159 | 160 | 161 | = 162 | 163 | = 164 | 165 | 166 | # Oct 11, 2014 要开始进入Rock2的时代了 167 | 168 | 第一块 PCB 样板到了 169 | 170 | ![image](http://radxa.com/mw/images/d/de/Rock2_module_pcb_top.png) 171 | 172 | 173 | ![image](http://radxa.com/mw/images/b/bf/Rock2_module_pcb_bottom.png) 174 | 175 | - Oct 11, 2014 176 | 177 | module 终于 SMT 了,现在等待 baseboard... 178 | 179 | ![image](http://radxa.com/mw/images/9/9d/Rock2_module_smt.jpg) 180 | 181 | - Nov 2, 2014 182 | 183 | base board 到了,酷吗? 184 | 185 | ![image](http://radxa.com/mw/images/b/b0/Rock2_base_top.jpg) 186 | 187 | ![image](http://radxa.com/mw/images/8/82/Rock2_base_bottom.jpg) 188 | 189 | Bring up: 190 | 191 | 如何使 basic system 在 rock2 上运行? 192 | 193 | 194 | [Rock2 bringing up](http://radxa.com/Rock2/bringup) 195 | 196 | 197 | 198 | 参考: 199 | 200 | - http://radxa.com/Rock2/full_bb 201 | -------------------------------------------------------------------------------- /_posts/linux/2015-01-05-how-to-flash-on-linux.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Linux 下如何刷机 4 | category: Linux 5 | tags: [刷机] 6 | keywords: 刷机 7 | description: 8 | --- 9 | 10 | 参考: 11 | 12 | 1. http://cn.radxa.com/forum.php?mod=viewthread&tid=66&extra=page%3D1 13 | 14 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-17-build-linux-image.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Linux系统固件制作 4 | category: Linux 5 | tags: [linux] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # 制作Linux系统的固件 11 | 12 | 本篇文章将详细介绍如何制作Rock lite/pro上运行的Linux固件,你需要的,就是一台能上网的Ubuntu的电脑 13 | 14 | ## 1.编译环境 15 | 16 | #### 下载交叉编译工具链 17 | 18 | ##### 64bit 主机 19 | `git clone -b kitkat-release --depth=1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6` 20 | 21 | 或者这里下载http://dl.radxa.com/rock/source/x86_64_arm-eabi-4.6.zip 22 | 23 | ##### 32bit 主机 24 | `git clone -b jb-release --depth=1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6` 25 | 26 | 或者在这里下载http://dl.radxa.com/rock/source/x86_32_arm-eabi-4.6.zip 27 | 28 | 29 | 30 | #### 设置环境变量 31 | 32 | `export ARCH=arm` 33 | `export CROSS_COMPILE=`pwd`/arm-eabi-4.6/bin/arm-eabi-` 34 | 35 | **需要注意的是,上面CROSS_COMPILE是表示编译器的路经,make的时候,会从该路经寻找编译器,可能需要改变,因为也许你已经安装过該编译器,或者说你想使用你其他编译器,这时候,就需要特别注意该变量的值。** 36 | 37 | ## 2.获取Linux内核源码 38 | 39 | * Kernel v3.0: 40 | `git clone -b radxa-stable-3.0 https://github.com/radxa/linux-rockchip.git` 41 | 42 | 43 | ## 3.编译内核 44 | 45 | * 进入内核根目录内 46 | `cd linux-rockchip` 47 | * 如果你的板子是2014版的pro或者lite,那么请使用radxa_rock_pro_linux_defconfig 48 | `make radxa_rock_pro_linux_defconfig` 49 | * 如果你的板子是2013版的pro或者lite,那么请使用radxa_rock_linux_defconfig 50 | `make radxa_rock_linux_defconfig` 51 | **所有的配置文件都保存在/arch/arm/configs/目录下,你可以根据需要,修改配置文件,或者使用我们推荐的配置文件** 52 | * 开始编译 53 | `make -j8` 54 | 55 | 生成的内核镜像文件位置是在 arch/arm/boot/Image。 56 | 57 | ## 4.编译内核模块 58 | 59 | `mkdir modules` 60 | `export INSTALL_MOD_PATH=./modules` 61 | `make modules && make modules_install` 62 | `cd ..` 63 | 64 | 现在所以的内核模块都在 modules/lib/modules/3.0.36+/文件夹中。待会儿在制作文件系统的时候需要用到。 65 | 66 | ## 5.制作booting.img镜像 67 | 68 | * 获取虚拟磁盘镜像 69 | `git clone https://github.com/radxa/initrd.git` 70 | `cd initrd` 71 | `find . ! -path "./.git*" | cpio -H newc -ov > initrd.img` 72 | 此时,在当前文件夹下,就会生成一个initrd.img的文件 73 | 74 | * 获取打包工具mkbooting 75 | `wget http://dl.radxa.com/rock/tools/linux/mkbootimg` 76 | `sudo apt-get install lib32stdc++6` 77 | `hmod +x mkbootimg` 78 | 79 | * 进行打包,具体路径根据你的当前路径确定 80 | `./mkbootimg --kernel linux-rockchip/arch/arm/boot/Image --ramdisk initrd.img -o boot.img` 81 | 完成。现在已经生成了RR的“boot.img”文件了。 82 | 83 | 此时生成的“booting.img”镜像,只是一个内核和虚拟磁盘的打包,是无法真正启动一块板子的。 84 | 85 | ## 6.制作根文件系统rootfs 86 | 87 | * 首先选择下载一个根文件系统 88 | http://releases.linaro.org/ 89 | 90 | * 然后申请一块和下载的文件系统大小略多的空间 91 | `dd if=/dev/zero of=rootfs.img bs=1M count=256` 92 | 93 | * 为这个文件系统分区命名为linuxroot 94 | `mkfs.ext4 -F rootfs.img -L linuxroot` 95 | (该名字被使用在内核开启时寻找文件系统使用,我们在使用upgrade_tool时,也可以只烧录文件系统,使用该分区名,如: 96 | `upgrade_tool di linuxroot rootfs.img`) 97 | 98 | * 把这个分区文件挂载到/mnt下 99 | mount -o loop rootfs.img /mnt 100 | 101 | * 解压linaro的tar gz rootfs的所有内容到/mnt下,即不要带有解压包名字的文件夹。bin、tmp等文件夹应在PC的mnt文件夹下。 102 | 103 | * 然后取消挂载 104 | `umount /mnt` 105 | 106 | 这样,就制作好了一个Linux文件系统。 107 | 108 | ## 6.完成固件制作的最后一步 109 | 110 | 获取打包工具 111 | `git clone https://github.com/radxa/rockchip-pack-tools.git` 112 | 113 | 文件夹下会得到一个package-file的文件 114 | *{ 115 | # NAME Relative path 116 | #HWDEF HWDEF 117 | package-file package-file* 118 | bootloader RK3188Loader(L)_V2.19.bin 119 | **parameter parameter** 120 | **boot Linux/boot-linux.img** 121 | *linuxroot Linux/rootfs.img 122 | backup RESERVED 123 | update-script update-script 124 | recover-script recover-script 125 | }* 126 | 127 | 里面列出了一个完整的updata.img所需要的全部组件。 128 | 129 | 其中,加粗的部分,是我们刚刚制作好的booting.img,以及文件系统rootfs。其他部分在该文件夹下都已提供。你可以选择把package-file文件中的相应部分改成你制作的文件名字,或把你制作的文件名字改成和package-file中一致,且路径相同,然后执行 该目录下的一个脚本 130 | `./mkupdate.sh ` 131 | 132 | 即得到可烧录的updata.img镜像。 133 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-17-build-mainline-kernel.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 为Rock编译3.18及以上Linux内核 4 | category: Linux 5 | tags: [linux,内核] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | # 为Rock编译3.18及以上Linux内核 11 | 12 | ## 1.环境需要 13 | 14 | * Ubuntu系统 15 | * GCC4.9+(4.8不支持) 16 | 17 | ## 2.获取源码 18 | 19 | * kernel v3.18: 20 | https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.18.11.tar.xz 21 | 同时还要获取配置文件 22 | `wget http://rockchip.fr/radxa/linux/rockchip_defconfig -O arch/arm/configs/rockchip_defconfig` 23 | `wget http://rockchip.fr/radxa/linux/rk3188-radxarock.dts -O arch/arm/boot/dts/rk3188-radxarock.dts` 24 | 25 | * Kernel v4.0:`git clone -b stable --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git` 26 | 获取配置文件 27 | `wget http://rockchip.fr/radxa/linux/rockchip_defconfig -O` 28 | `wget http://rockchip.fr/radxa/linux/rk3188-radxarock.dts -O arch/arm/boot/dts/rk3188-radxarock.dts` 29 | 30 | ## 3.编译内核 31 | 32 | `export ARCH=arm` 33 | `export CROSS_COMPILE=arm-linux-gnueabihf-` 34 | 35 | 上面的CROSS_COMPILE变量是指gcc编译器的路径名,可能需要根据具体情况修改 36 | 37 | ## 4.创建boot镜像 38 | 39 | * 如果你没有mkbootimg工具的话,按照下面的方式下载,如果有的话,则跳过 40 | `git clone https://github.com/neo-technologies/rockchip-mkbootimg.git` 41 | `cd rockchip-mkbootimg` 42 | `make` 43 | `sudo make install` 44 | `cd ..` 45 | 46 | * 对于V3.18之后的内核,我们还需要把设备树(dtb)附加到内核镜像中,因为现在U-boot还不支持这个操作 47 | `cat arch/arm/boot/zImage arch/arm/boot/dts/rk3188-radxarock.dtb > zImage-dtb` 48 | 49 | * 制作虚拟磁盘 50 | `git clone https://github.com/radxa/initrd.git` 51 | `find . ! -path "./.git*" | cpio -H newc -ov > initrd.img` 52 | 53 | * 开始打包生成 54 | `mkbootimg --kernel zImage-dtb --ramdisk initrd.img -o boot.img` 55 | 56 | 得到镜像booting.img! 57 | 58 | 然后再利用烧录工具进行烧录就可以了 ! 59 | 60 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-17-build-ubuntu-rootfs.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 完善ubuntu的文件系统 4 | category: Linux 5 | tags: [linux,ubuntu] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | # 完善ubuntu的文件系统 11 | 12 | 我们之前在Linux固件制作的文档中,已经有制作了一个Ubuntu的文件镜像,但是那个文件镜像是“别人的”,现在我们就来说说如何制作你想要的、更是你需要的文件系统。 13 | 14 | # 准备工作 15 | 16 | * 安装一个工具包 17 | `sudo apt-get install qemu-user-static binfmt-support` 18 | 19 | * 然后如之前的操作一样,制作一个空的文件系统,并且挂载它到/mnt下 20 | `dd if=/dev/zero of=rock_rootfs.img bs=1M count=1024` 21 | `mkfs.ext4 -F -L linuxroot rock_rootfs.img ` 22 | `sudo mount -o loop rock_rootfs.img /mnt` 23 | 24 | * 接着下载一个[文件系统](https://releases.linaro.org),然后“塞”进去。**下面的包名字和路经是随机的,大家根据自己的路经,视情况而进行替换** 25 | `sudo tar zxvf linaro-raring-alip-20130826-474.tar.gz -C /mnt` 26 | `cd /mnt` 27 | `sudo mv binary/*` 28 | `sudo rmdir binary` 29 | 30 | * 拷贝我们之前编译内核时,编译好的内核模块 31 | `sudo mkdir -p /mnt/lib/modules` 32 | `sudo cp -r /modules/lib/modules/3.0.36+ /mnt/lib/modules` 33 | 34 | * 准备chroot 35 | `sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin` 36 | `sudo modprobe binfmt_misc` 37 | `sudo mount -t devpts devpts /mnt/dev/pts` 38 | `sudo mount -t proc proc /mnt/proc` 39 | 40 | * chroot进入文件系统 41 | `sudo chroot /mnt` 42 | 43 | 现在我们进来文件系统了,shell变成了”root@target:#“。 44 | 45 | * 修改默认的shell bash 46 | `root@target:# rm /bin/sh && ln -s /bin/bash /bin/sh` 47 | 48 | * 然后,你就可以利用平时我们操作ubuntu系统的一切命令来操作这个系统,安装软件、更改配置等等 49 | 50 | * 我们建议你进行一项操作,就是增加一个开机脚本,让你可以增加一些开机启动的程序 51 | `vim /usr/local/bin/mtd-by-name.sh` 52 | 53 | 加入下列文本 54 | *{ 55 | #!/bin/sh -e 56 | # mtd-by-name link the mtdblock to name 57 | # radxa.com, thanks to naobsd 58 | rm -rf /dev/block/mtd/by-name/ 59 | mkdir -p /dev/block/mtd/by-name 60 | for i in `ls -d /sys/class/mtd/mtd*[0-9]`; do 61 | name=`cat $i/name` 62 | tmp="`echo $i | sed -e 's/mtd/mtdblock/g'`" 63 | dev="`echo $tmp |sed -e 's/\/sys\/class\/mtdblock/\/dev/g'`" 64 | ln -s $dev /dev/block/mtd/by-name/$name 65 | done 66 | }* 67 | 68 | * 在/etc/rc.local文件 “exit 0”前加入下面文字 69 | > /usr/local/bin/mtd-by-name.sh 70 | 71 | * 回到PC系统 72 | `exit` 73 | `sync` 74 | `sudo umount /mnt` 75 | 76 | 然后在继续Linux固件制作的步骤! 77 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-17-install-ROS.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: ROS在Ubuntu系统下的安装 4 | category: Linux 5 | tags: [产品, 配置] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | 11 | # ROS Jade在Rock2 square上的安装 12 | 13 | 本文将介绍如何在Rock2 square的Ubuntu系统安装ROS系统,其他关于ROS的介绍和教程请登录http://wiki.ros.org 14 | 15 | 不过首先你需要准备好一个安装好ubuntu系统的rock2 square,并且能连上网络。 16 | 17 | ## 配置环境 18 | 19 | * 设置系统的安装库来源 20 | 21 | 备份apt的源配置文件 22 | `sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup` 23 | 24 | 查看该文件可以看到类似这么几行,如果没有,请加上它,并且保证它不是被注释的信息 25 | 26 | > deb http://us.archive.ubuntu.com/ubuntu/ saucy universe restricted multiverse 27 | deb-src http://us.archive.ubuntu.com/ubuntu/ saucy universe restricted multiverse 28 | deb http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe restricted multiverse 29 | deb-src http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe restricted multiverse 30 | 31 | 重点在于后面三个条件 universe restricted multiverse,补全他们 32 | 33 | * 设置环境变量 34 | 35 | `sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX` 36 | 37 | * 增加来源 38 | 39 | `sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'` 40 | 41 | * 设置锁 42 | 43 | `wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -` 44 | 45 | * 更新设置 46 | 47 | `sudo apt-get updata` 48 | 49 | ## 安装ROS Jade 50 | 51 | * 基础安装 52 | `sudo apt-get install ros-jade-ros-base` 53 | 54 | * 个性化安装 55 | 需要注意的是,上面的安装下载包括了许多基础组件,都不是图形界面的,需要一定下载时间,如 果你想要安装一些个人需要的组件,可以先使用下面的命令搜索所有的组件 56 | `apt-cache search ros-jade` 57 | 58 | 然后选择你所需要的包名字,使用下列命令 59 | `sudo apt-get install ros-jade-PACKAGE` 60 | 61 | 例如你看到一个包叫做ros-jade-navigation,则使用下列命令 62 | `sudo apt-get install ros-jade-navigation` 63 | 64 | ## 初始化ROS 65 | 66 | 在使用ROS之前,你将需要安装和初始化rosdep。当你安装运行新的ROS组件时,这个工具能够 帮助你方便地建立依赖软件依赖关系。 67 | 68 | `sudo apt-get install python-rosdep` 69 | `sudo rosdep init` 70 | `rosdep update` 71 | 72 | ## 软件环境变量 73 | 74 | `echo "source /opt/ros/jade/setup.bash" >> ~/.bashrc` 75 | `source ~/.bashrc` 76 | 77 | ## 获取rosinstall 78 | 79 | rosinstall是经常被使用的命令行工具,它能让你使用一行命令就下载好组件,使用下面命令安装 80 | 81 | sudo apt-get install python-rosinstall 82 | 83 | ## 最后设置 84 | 85 | 最后我们还需要一个设置,因为ROS不能识别Linaro的系统,所以我们需要更改/etc/lsb-release文件中的系统信息,只需要把Linaro改成Ubuntu就好,其他不用变,类似下面这样子 86 | 87 | > DISTRIB_ID=Ubuntu 88 | DISTRIB_RELEASE=14.04 89 | DISTRIB_CODENAME=trusty 90 | DISTRIB_DESCRIPTION="Ubuntu 14.04" 91 | 92 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-17-tty-debug.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: linux下通过串口调试Rock 4 | category: Linux 5 | tags: [产品, 配置] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | # 如何通过串口调试Rock设备 11 | 12 | 首先你需要准备 13 | * 一个Rock的板子 14 | * 一条TTL to USB的线 15 | * 一台PC机,可以运行Windows/Linux/Moc OS 16 | 然后就可以开始了 17 | 18 | ## 连接设备 19 | 20 | 板子 TTL串口线 21 | RX -> 绿色 22 | TX -> 白色 23 | GND -> 黑色 24 | 25 | **警告:不要连接红色的线到板子上,那样会损坏开发板,建议直接剪断红色的线,毕竟有的人手速比较快** 26 | 27 | ![image](http://radxa.com/mw/images/c/c5/Serial_cable_use.jpg) 28 | 29 | ## 设置PC设备 30 | 31 | ### Windows 32 | 33 | 我们在这里以Putty为例,展示以下如何设置调试工具 34 | 35 | * 双击Putty.exe,你会看到下面这个画面 36 | 37 | ![imaga](http://radxa.com/mw/images/d/da/Serial_debug_0.png) 38 | 39 | * 接下来选择Serial,并填写正确的端口,端口传输速率为115200 40 | 41 | ![iamge](http://radxa.com/mw/images/9/90/Serial_debug_2.png) 42 | 43 | * 可以在Windows的设备管理器中,查看端口 44 | 45 | ![img](http://radxa.com/mw/images/7/78/Serial_debug_1.png) 46 | 47 | * 完成设置后,点击Open,Putty就开始工作了 48 | 49 | ### Linux 50 | 51 | 对于在Linux下连接UART/Serial,picocom 是一个非常方便的终端工具,或者你也可以使用Putty for Linux 52 | 53 | ##### Picocom 54 | 55 | * 假如你使用Ubuntu的系统,你需要把当前用户添加到diaout组里面,然后重新登入,让该设置立马生效 56 | `sudo adduser $USER dialout` 57 | `gnome-session-quit` 58 | 59 | * 安装picocom 60 | `sudo apt-get install picocom` 61 | 62 | * 使用通信速率115200打开该串口 63 | `picocom /dev/ttyUSB0 -b 115200 -e w` 64 | 65 | 注意:ESC字符被设置成‘w’,你需要按ctrl-w,ctrl-z来退出 66 | 67 | ##### Putty 68 | 69 | * 打开Putty时,你可以看到如下界面 70 | ![image](http://radxa.com/mw/images/1/13/Serial_debug_linux_0.png) 71 | 72 | * 接下来选择Serial,并填写正确的端口,端口传输速率为115200 73 | ![iamg](http://radxa.com/mw/images/c/cb/Serial_debug_linux_1.png) 74 | 75 | 完成! 76 | 77 | ### Mac OS 78 | 79 | * download [ PL2303 Mac OS X Driver](http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41),这个一个驱动,安装好了之后,你还需要重启一下机器 80 | 81 | * 然后使用[Homebrew](http://brew.sh/)管理工具安装piococom 82 | `brew install picocom` 83 | 84 | * 以下面的方式打开该软件 85 | `picocom /dev/tty.usbserial -b 115200 -e w` 86 | 87 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-18-boot-FreeBSD.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 如何启动 FreeBSD 4 | category: Linux 5 | tags: [产品, 配置] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | # 如何启动 FreeBSD 10 | 11 | Ganbold,一个FreeBSD开发者,现在搞定了在Rockchip平台上的FreeBSD引导工作。Ganbold 告诉我们只有基本模块、GPIO、DWC 12 | 13 | USB主机模式可以工作。但这只是个开始,如果你感兴趣,在#radxa的免费IRC频道联系Ganbold,以获取更详细的资料。 14 | 15 | 请看 FreeBSD ARM wiki的介绍: 16 | 17 | https://wiki.freebsd.org/FreeBSD/arm/Radxa%20Rock 18 | 19 | 使用Ubuntu 13.10 amd64 并且使用rkflashtool 编译的请注意: 20 | 21 | * 通过 sudo apt-get -y install libusb-1.0-0-dev来安装 libusb.h 22 | 23 | * 拔掉板子电源。然后按住Recovery按键,再连接USB线(连接到OTG接口的)到计算机,等3秒钟松开Recovery按键。 如果此时RK3188没有进入Recovery模式,你在运行 ./rkflashtool p > param.txt 时,会出现:"rkflashtool: fatal: cannot open device"。 24 | 25 | * 使用下面的Makefile: 26 | 27 | > # 28 | all: rkflashtool 29 | 30 | rkflashtool: rkflashtool.c 31 | gcc -o rkflashtool rkflashtool.c -I/usr/include/libusb-1.0/ -lusb-1.0 -O2 -W -Wall 32 | 33 | clean: 34 | rm -f rkflashtool 35 | 36 | param: 37 | sudo ./rkflashtool r 0x0000 0x2000 > /tmp/parm 38 | 39 | # 40 | 41 | 42 | # 启动日志 43 | 44 | > KDB: debugger backends: ddb 45 | KDB: current backend: ddb 46 | Copyright (c) 1992-2014 The FreeBSD Project. 47 | Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 48 | The Regents of the University of California. All rights reserved. 49 | FreeBSD is a registered trademark of The FreeBSD Foundation. 50 | FreeBSD 11.0-CURRENT #0: Wed May 28 15:59:10 UTC 2014 51 | root@beaglebone:/usr/src/sys/arm/compile/RADXA arm 52 | FreeBSD clang version 3.4 (tags/RELEASE_34/final 197956) 20140216 53 | CPU: Cortex A9-r3 rev 0 (Cortex-A core) 54 | Supported features: ARM_ISA THUMB2 JAZELLE THUMBEE ARMv4 Security_Ext 55 | WB disabled EABT branch prediction enabled 56 | LoUU:2 LoC:1 LoUIS:2 57 | Cache level 1: 58 | 32KB/32B 4-way data cache WB Read-Alloc Write-Alloc 59 | 32KB/32B 4-way instruction cache Read-Alloc 60 | real memory = 2147483648 (2048 MB) 61 | avail memory = 2095329280 (1998 MB) 62 | FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs 63 | random: initialized 64 | ofwbus0: 65 | simplebus0: on ofwbus0 66 | gic0: mem 0x1013d000-0x1013dfff,0x1013c100-0x1013c1ff on simplebus0 67 | gic0: pn 0x390, arch 0x1, rev 0x2, implementer 0x43b sc->nirqs 160 68 | rk30_pmu0: mem 0x20004000-0x200040ff on simplebus0 69 | rk30_grf0: mem 0x20008000-0x20009fff on simplebus0 70 | mp_tmr0: mem 0x1013c200-0x1013c2ff,0x1013c600-0x1013c61f irq 27,29 on simplebus0 71 | Timecounter "MPCore" frequency 148500000 Hz quality 800 72 | Event timer "MPCore" frequency 148500000 Hz quality 1000 73 | k30_wd0: mem 0x2004c000-0x2004c0ff on simplebus0 74 | gpio0: mem 0x2000a000-0x2000a0ff irq 86 on simplebus0 75 | gpioc0: on gpio0 76 | gpiobus0: on gpio0 77 | gpio1: mem 0x2003c000-0x2003c0ff irq 87 on simplebus0 78 | device_attach: gpio1 attach returned 6 79 | gpio1: mem 0x2003e000-0x2003e0ff irq 88 on simplebus0 80 | device_attach: gpio1 attach returned 6 81 | gpio1: mem 0x20080000-0x200800ff irq 89 on simplebus0 82 | device_attach: gpio1 attach returned 6 83 | dwcotg0: mem 0x10180000-0x101bffff irq 48 on simplebus0 84 | usbus0 on dwcotg0 85 | dwcotg1: mem 0x101c0000-0x101fffff irq 49 on simplebus0 86 | usbus1 on dwcotg1 87 | uart0: <16650 or compatible> mem 0x20064000-0x200643ff irq 68 on simplebus0 88 | uart0: console (115200,n,8,1) 89 | Timecounters tick every 10.000 msec 90 | usbus0: 480Mbps High Speed USB v2.0 91 | usbus1: 480Mbps High Speed USB v2.0 92 | ugen1.1: at usbus1 93 | uhub0: on usbus1 94 | ugen0.1: at usbus0 95 | uhub1: on usbus0 96 | random: unblocking device. 97 | Release APs 98 | Root mount waiting for: usbus1 usbus0 99 | uhub0: 1 port with 1 removable, self powered 100 | uhub1: 1 port with 1 removable, self powered 101 | ugen1.2: at usbus1 102 | uhub2: on usbus1 103 | Root mount waiting for: usbus1 104 | uhub2: 4 ports with 4 removable, self powered 105 | Root mount waiting for: usbus1 106 | ugen1.3: at usbus1 107 | usbd_set_config_index: could not read device status: USB_ERR_SHORT_XFER 108 | Root mount waiting for: usbus1 109 | ugen1.4: at usbus1 110 | umass0: on usbus1 111 | umass0: SCSI over Bulk-Only; quirks = 0x4100 112 | umass0:0:0: Attached to scbudsa00 113 | at umass-sim0 bus 0 scbus0 target 0 lun 0 114 | da0: Fixed Direct Access SCSI-2 device 115 | da0: Serial Number 00001504B59E 116 | da0: 40.000MB/s transfers 117 | da0: 152377MB (312069552 512 byte sectors: 255H 63S/T 19425C) 118 | da0: quirks=0x2 119 | Root mount waiting for: usbus1 120 | ugen1.5: at usbus1 121 | axe0: on usbus1 122 | Trying to mount root from ufs:/dev/da0s2 []... 123 | warning: no time-of-day clock registered, system time will not be set accurately 124 | miibus0: on axe0 125 | kphy0: PHY 16 on miibus0 126 | ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto 127 | ue0: on axe0 128 | ue0: Ethernet address: **:**:**:**:**:** 129 | Spurious interrupt detected [0x000003ff] 130 | 131 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-18-linux-sound.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Linux 声音设置 4 | category: Linux 5 | tags: [linux] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # Linux 声音设置 11 | 12 | ## HDMI/AV 输出音频 13 | 14 | * 你可以使用下面的命令去测试Radxa Rock上的音频: 15 | 16 | `root@radxa:~# speaker-test -t wav -c 2` 17 | 18 | * 会输出以下信息: 19 | 20 | > speaker-test 1.0.25 21 | Playback device is default 22 | Stream parameters are 48000Hz, S16_LE, 2 channels 23 | WAV file(s) 24 | Rate set to 48000Hz (requested 48000Hz) 25 | Buffer size range from 48 to 32768 26 | Period size range from 16 to 3072 27 | Using max buffer size 32768 28 | Periods = 4 29 | was set period_size = 2979 30 | was set buffer_size = 32768 31 | 0 - Front Left 32 | 1 - Front Right 33 | Time per period = 2.061311 34 | 35 | * 此时你会从HDMI或者使用耳机(插在AV输出端子上)听到声音。 36 | 37 | ## SPDIF 38 | 39 | 如果你设置成默认从SPDIF输出音频的话,可以创建 /etc/asound.conf 并增加以下内容: 40 | 41 | > pcm.!default { 42 | type hw 43 | card 1 44 | device 0 45 | } 46 | ctl.!default { 47 | type hw 48 | card 1 49 | } 50 | 51 | ## 在Rock上使用 USB DAC 的 Squeezelite 52 | 53 | * 在Logitech媒体服务器上使用USB DAC的squeezelite播放是可以实现的。没有Logitech媒体服务器的话,squeezelite是没有任何价值的。在我的附近有一些LMS的实例. 54 | 55 | * 从这里下载[Squeezelite AMRV6hf](https://code.google.com/p/squeezelite/downloads/detail?name=squeezelite-armv6hf&can=2&q=) 56 | `sudo mv ./squeezelite-armv6hf /usr/bin/squeezelite` 57 | `sudo chmod ug+x /usr/bin/squeezelite` 58 | 59 | * 把Dac插到USB中,并输入: 60 | `squeezelite -l` 61 | 62 | * 会列出所有的音频设备,我通常使用前端设备。然后输入: 63 | `squeezelite -o front:CARD=DAC,DEV=0 -n ANYNAMEYOUWANT -s YOUR . SERVER . ADDRESS -a ::16:` 64 | 65 | * 例如: 66 | `squeezelite -o front:CARD=DAC,DEV=0 -n RadxaRock -s 10.0.1.99 -a ::16:` 67 | 68 | 然而不幸的是我没办法让它连续工作24小时这么长。现在主要在监测一些爆破音,并想方设法去获取这些爆破音。如果你有好的想法请告诉我。 69 | 70 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-18-linux-vnc-server.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 设置VNC服务器 4 | category: Linux 5 | tags: [产品] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | ## 设置VNC服务器 11 | 12 | 你可以通过设定VNC(Virtu Network Computing)服务器从网络上远程进入你的radxa rock桌面. 13 | 14 | * 如果你还没有在你的rock板上安装VNC服务器,需要用下面的命令安装它(前提是你的板子能连接网络): 15 | `sudo apt-get install tightvncserver` 16 | 17 | * 第一次运行时设定密码: 18 | `root@radxa:~# vncserver` 19 | 20 | * 你需要设定一个进入桌面的密码:并且再次确认它 21 | 22 | > Password: ***** 23 | Warning: password truncated to the length of 8. 24 | Verify: ***** 25 | 26 | * 询问你是否要设置一个查询密码时,选择n 27 | 28 | > Would you like to enter a view-only password (y/n)? n 29 | xauth: file /root/.Xauthority does not exist 30 | New 'X' desktop is radxa:1 31 | Creating default startup script /root/.vnc/xstartup 32 | Starting applications specified in /root/.vnc/xstartup 33 | Log file is /root/.vnc/radxa:1.log 34 | 35 | * 现在编辑 ~/.vnc/xstartup 文件,并在 x-window-manager 后面添加一行,就像: 36 | 37 | > \#!/bin/sh 38 | xrdb $HOME/.Xresources 39 | xsetroot -solid grey 40 | \#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & 41 | \#x-window-manager & 42 | startlubuntu & 43 | \# Fix to make GNOME work 44 | export XKL_XMODMAP_DISABLE=1 45 | /etc/X11/Xsession 46 | 47 | * 现在重启VNC服务: 48 | `root@radxa:~# vncserver -kill :1` 49 | `root@radxa:~# vncserver -geometry 1280x800 :1` 50 | 51 | 现在Rock板子上运行的VNC服务器桌面分辨率是1280x800的。 52 | 53 | ## 远程桌面 54 | 55 | #### Linux 56 | 57 | * 这里我们使用Remmina Remote Desktop 作为VNC客户端,用于进入rock的远程桌面。 单击 'plus'按钮,创建一个新的VNC连接,并按照如下步骤配置它: 58 | 59 | Name: 随便你起 60 | 61 | Group: 可以留空 62 | 63 | Protocal: 选择 "VNC - Virtual Network Computing" 64 | 65 | Server: 输入你的rock板子的IP地址,后面加上 “:1”,比如 192.168.1.101:1 66 | 67 | Color depth: 选择True color(24 bit) 68 | 69 | Quality: 选择 best 70 | 71 | * 下面是配置的例子: 72 | 73 | ![Remmina profile.png](http://radxa.com/mw/images/8/8b/Remmina_profile.png) 74 | 75 | 现在单击 “connect”,输入我们刚才设定的密码就可以了。 76 | 77 | ![Remmina pw.png](http://radxa.com/mw/images/4/47/Remmina_pw.png) 78 | 79 | #### Windows 80 | 81 | 在Windows平台,我们使用VNC Viewr来作为VNC的客户端,使用它你可以远程查看并控制你的Radxa板子的桌面环境。 它的使用很简单,你可以按照下面的方法配置它: 82 | 83 | Server: 你的Radxa Rock板子的IP地址,后面加上":1",比如 192.168.1.101:1 然后单击 'OK',启动连接。 84 | 85 | ![VNCConfig-1.jpg](http://radxa.com/mw/images/9/94/VNCConfig-1.jpg) 86 | 87 | 下面输入我们之前设定的密码,并单击OK: 88 | 89 | ![VNCConfig-2.jpg](http://radxa.com/mw/images/f/fd/VNCConfig-2.jpg) 90 | -------------------------------------------------------------------------------- /_posts/linux/2015-07-20-bootloader.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 关于bootloader和U-boot 4 | category: 上手指南 5 | tags: [启动,bootloader] 6 | keywords: 产品, 配置 7 | description: 8 | --- 9 | 10 | 11 | # bootloader 12 | 13 | 目前绝大多数的基于RK3188的设备,包括Radxa Rock,都是使用Rockchip自身的bootloader。不幸的是,Rockchip并不提供bootloader的源代码。 14 | 15 | 少数RK3188的设备使用U-boot。 16 | 17 | bootloader的主要任务是 18 | 19 | * 导入并且校验parameter文件 20 | * 导入并且运行misc分区的命令 21 | * 导入,校验,启动内核,randisk,boot等各个分区,或者是recovery分区刷机 22 | * 连接PC主机,下载镜像、固件用以升级 23 | 24 | 下载用于Radxa Rock的bootloader可以从这个地址 25 | 26 | http://dl.radxa.com/rock/images/loader/ 27 | 28 | 假如你感兴趣的话,你可以从这个地方查看一些别人对它的分析 29 | 30 | https://gist.github.com/sarg/5028505 31 | 32 | 或者说是下面的国内的地址 33 | 34 | http://blog.csdn.net/faithsws/article/details/17245699 35 | 36 | 37 | 38 | # U-boot for rockchip 39 | 40 | 41 | ## 在NAND上载入U-boot 42 | 43 | #### 编译U-boot 44 | 45 | * 首先你要确保你拥有编译链工具arm-eabi,如果没有,参考[这个](http://radxa.com/Rock/install_toolchain),并且保证环境变量“ARCH”、“CROSS——COMPILE”,的值分别为‘arm’、编译链工具的路经。 46 | 47 | * 获取源码 48 | `git clone -b u-boot-rk3188 https://github.com/radxa/u-boot-rockchip.git` 49 | 50 | * 进入目录,开始编译('xx'不需要更换) 51 | `cd u-boot-rockchip` 52 | `make rk30xx` 53 | 54 | 编译结束后,我们会在文件当前目录下得到两个二进制文件,‘RK3188Loader_miniall.bin’ 还有 ‘uboot.img’. 55 | 56 | 57 | #### 刷boot 58 | 59 | * 首先需要获取工具,并且了解一些工具的使用常识,你可以参考[这里](http://radxa.com/Rock/flash_the_image) 60 | 61 | * 使用擦除旧的程序 62 | `sudo upgrade_tool ef RK3188Loader_miniall.bin` 63 | 64 | * 刷入新的loader 65 | `sudo upgrade_tool ul RK3188Loader_miniall.bin` 66 | 67 | * 格式化NAND(只需要第一次这么做) 68 | `sudo upgrade_tool lf` 69 | 70 | * 刷入paremeter 71 | `upgrade_tool di -p parameter` 72 | 73 | paramter file 74 | 75 | > FIRMWARE_VER:4.2.2 76 | MACHINE_MODEL:radxa_rock 77 | MACHINE_ID:007 78 | MANUFACTURER:RADXA 79 | MAGIC: 0x5041524B 80 | ATAG: 0x60000800 81 | MACHINE: 3066 82 | CHECK_MASK: 0x80 83 | KERNEL_IMG: 0x60408000 84 | CMDLINE:console=ttyFIQ0,115200 console=tty0 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init mac_addr=de:ad:de:ad:be:ef initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00008000@0x00004000(boot),-@0x000c0000(linuxroot) 85 | 86 | 87 | * 输入U-boot 88 | `sudo upgrade_tool wl 0x2000 uboot.img` 89 | `sudo upgrade_tool rd` 90 | 91 | * 刷入内核+虚拟磁盘 92 | `upgrade_tool di -b boot-linux.img` 93 | 94 | * 刷入文件系统 95 | `upgrade_tool di linuxroot rootfs.img` 96 | 97 | 98 | ## 载入U-boot到SD卡中 99 | 100 | #### 编译u-boot 101 | 102 | * 首先你要确保你拥有编译链工具arm-eabi,如果没有,参考[这个](http://radxa.com/Rock/install_toolchain),并且保证环境变量“ARCH”、“CROSS——COMPILE”,的值分别为‘arm’、编译链工具的路经。 103 | 104 | * 获取源码 105 | `git clone -b u-boot-rk3188-sdcard https://github.com/radxa/u-boot-rockchip.git` 106 | 107 | * 进入目录,开始编译('xx'不需要更换) 108 | `cd u-boot-rockchip` 109 | `make rk30xx` 110 | 111 | * 现在我们需要进行最后一个操作 112 | `./pack-sd.sh` 113 | 114 | 我们会得到另一个我们需要的二进制文件‘u-boot-sd.img' 115 | 116 | #### 导入SD卡中 117 | 118 | 我们只需要执行以下命令就可以完成这个操作 119 | `sudo dd if=u-boot-sd.img of=/dev/sdx seek=64` 120 | 121 | 122 | ## 操作失误导致“变砖” 123 | 124 | 如果你在进行上述操作的时候,出现某些错误,导致设备无法启动了,你需要参考[如何解砖](http://radxa.com/Rock/unbrick) 125 | 126 | # 一些参考链接 127 | 128 | * http://androtab.info/rockchip/u-boot/ (working binaries) 129 | 130 | * https://github.com/linux-rockchip/u-boot-rockchip (some improvement) 131 | -------------------------------------------------------------------------------- /_posts/rock2/2015-05-17-rock2-full-baseboard.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Rock2 Full Baseboard 4 | category: Rock2 5 | tags: [产品,rock2] 6 | keywords: Rock2 Full Baseboard 7 | description: Rock2 Full Baseboard 8 | --- 9 | 10 | - Oct 11, 2014 11 | 12 | 第一块 PCB 样板到了 13 | 14 | ![image](http://radxa.com/mw/images/d/de/Rock2_module_pcb_top.png) 15 | 16 | 17 | ![image](http://radxa.com/mw/images/b/bf/Rock2_module_pcb_bottom.png) 18 | 19 | - Oct 11, 2014 20 | 21 | module 终于 SMT 了,现在等待 baseboard... 22 | 23 | ![image](http://radxa.com/mw/images/9/9d/Rock2_module_smt.jpg) 24 | 25 | - Nov 2, 2014 26 | 27 | base board 到了,酷吗? 28 | 29 | ![image](http://radxa.com/mw/images/b/b0/Rock2_base_top.jpg) 30 | 31 | ![image](http://radxa.com/mw/images/8/82/Rock2_base_bottom.jpg) 32 | 33 | Bring up: 34 | 35 | 如何使 basic system 在 rock2 上运行? 36 | 37 | 38 | [Rock2 bringing up](http://radxa.com/Rock2/bringup) 39 | 40 | 41 | 参考: 42 | 43 | - http://radxa.com/Rock2/full_bb 44 | 45 | -------------------------------------------------------------------------------- /_posts/rock2/2015-05-17-rock2-loader-mode.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Rock2如何进入loder mode? 4 | category: Rock2 5 | tags: [rock2,loder] 6 | keywords: loder,rock2 7 | description: Rock2如何进入loder 模式? 8 | --- 9 | 10 | 当板子如法启动,等待从PC通过USB OTG接口的命令,此时板子处于Loder mode。square baseboard有三个键,恢复键、重启键和电源键(recovery key, reset key and the power key)。当进入loder mode时,我们需要使用恢复键和重启键。 11 | 12 | ![此处输入图片的描述][1] 13 | 14 | 为了进入loder mode,你应该: 15 | 16 | 1. 给板子上电,红色led指示板子开机 17 | 2. 连接USB OTG接口和PC(注意,你必须先连接OTG线,然后按下面的键) 18 | 3. 按住恢复键(靠近WiFi天线的那个) 19 | 4. 短按重启键(靠近DC的那个) 20 | 5. 放开恢复键 21 | 22 | 现在,开发板应该处于 loder 模式了。 23 | 24 | Windows 25 | 26 | Linux: 27 | 28 | 确保你有USB ID 2207:320a,此时rock2 square 处于loder模式了。 29 | 30 | ``` 31 | lsusb 32 | ... 33 | Bus 001 Device 018: ID 2207:320a 34 | ... 35 | ``` 36 | 37 | For developers: 38 | 39 | 在u-boot命令行,你可以输入rockusb来进去loder模式。 40 | 41 | 你还可以看: 42 | 43 | [Rock2/square_bb/hardware][2] 44 | [rock/Loader_mode][3] 45 | 46 | [1]: http://radxa.com/mw/images/1/1e/Loader_mode.jpg 47 | [2]: http://radxa.com/Rock2/square_bb/hardware 48 | [3]: http://radxa.com/Rock/Loader_mode 49 | 50 | 参考: 51 | 52 | - http://radxa.com/Rock2/square_bb/loader_mode 53 | 54 | -------------------------------------------------------------------------------- /_posts/rock2/2015-05-17-rock2-square-introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Rock2 Square 介绍 4 | category: Rock2 5 | tags: [产品,rock2] 6 | keywords: rock2 square 7 | description: Rock2 Square 介绍 8 | --- 9 | 10 | Rock2 square 基于Rochchip 最新的 RK3288 芯片, 关于RK3288芯片的介绍请参考 [RK3288百度百科][1]。 11 | 为了方便客户定制, 我们采用"核心板" + "底板"的方式。 12 | 13 | SOM 核心板 (目前有两个版本): 14 | 1) 2G RAM + 16G EMMC 15 | 2) 4G RAM + 32G EMMC 16 | 17 | ![此处输入图片的描述][2] 18 | 19 | |指标 |Square Baseboard | Full Baseboard| 20 | |----- |-----:|---:| 21 | |电源|5V/3A|5~12V/4A| 22 | |存储|uSD up to 128GB, 2.5" hard drive up to 4TB *|uSD up to 128GB, 2.5"/3.5" HD up to 4TB| 23 | |USB|1 x OTG, 3 x host|1 x OTG, 2 x host| 24 | |网络|1000M|Dual 1000M **| 25 | |显示|HDMI 2.0, eDP, LVDS***|HDMI 2.0, eDP, LVDS, MIPI| 26 | |无线|Bluetooth 4.0(BLE support), 802.11 a/b/g/n/c wifi|Bluetooth 4.0(BLE support), 802.11 a/b/g/n/c wifi, HSPA/WCDMA, EDGE/GPRS/GSM 27 | | 28 | |音频|SPDIF, Headphone with line in, Mic|Headphone with line in, Mic| 29 | |Misc|IR, debug UART, RTC|IR, debug UART, RTC| 30 | |扩展口|50pin 2mm LVDS, 40pin 2.54mm for gpio, i2c, uart, spi|2 x 40pin 2.54mm header for gpio, i2c, uart, spi| 31 | 32 | Base board 底板: 33 | 34 | ![此处输入图片的描述][3] 35 | 36 | 37 | [1]: http://baike.baidu.com/link?url=3_5NTBgwIDwgP1e0AudAXVFat7QSZqwDm1AaWGz9dgAM95ispDv28DcbTPAvLSctOMrdvzSeOcWXWE2WBhy-iq 38 | [2]: http://cn.radxa.com/data/attachment/forum/201504/09/120017cn80d661ozayjjnj.png 39 | [3]: http://cn.radxa.com/data/attachment/forum/201504/09/120110sor3e9ht8z8sjx8o.png 40 | 41 | 参考: 42 | 43 | - http://radxa.com/Rock2 44 | - http://cn.radxa.com/forum.php?mod=viewthread&tid=282 45 | -------------------------------------------------------------------------------- /_posts/rock2/2015-05-17-rock2-square-resources.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Rock2 Square 资源下载 4 | category: Rock2 5 | tags: [rock2] 6 | keywords: 资源,rock2,固件 7 | description: Rock2 Square 资源下载 8 | --- 9 | 10 | 固件下载地址 11 | 12 | 13 | ##Android## 14 | 15 | http://dl.radxa.com/rock2_square/images/android 16 | 17 | 18 | ##Linux## 19 | 20 | http://dl.radxa.com/rock2_square/images/nightly/ 21 | 22 | 23 | ##代码下载## 24 | 25 | - Android 26 | http://dl.radxa.com/rock2_square/source/ 27 | 28 | 29 | 参考: 30 | 31 | - http://cn.radxa.com/forum.php?mod=viewthread&tid=283&extra=page%3D1 -------------------------------------------------------------------------------- /_posts/start/2014-12-28-Flash-image-to-nand-linux.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 将image烧写到NAND(Linux) 4 | category: 上手指南 5 | tags: [入门, linux, image, NAND] 6 | keywords: image,NAND 7 | description: 8 | --- 9 | 10 | 11 | 12 | 从Android 4.4起,Rockchip提供了一个在Linux系统下的升级工具(闭源)。叫做“upgrade_tool”。 它支持烧写update.img、parameter、bootloader和其他分区,注意它是基于命令行的工具。 13 | 14 | 15 | * 下载工具 16 | 17 | 从[这里][2]下载Rockchip的Linux升级工具并解压,然后你会得到一个在Linux下二进制可执行文件,叫做“upgrade_tool”。 18 | 19 | * 让板子进入[Loader模式][1],并运行命令烧写升级包updata.img 20 | 21 | `sudo ./upgrade_tool uf /path/to/update.img` #(UF Upgrade Flash) 22 | 23 | * 如果你在升级过程中有一个错误,你可以首先使用以下命令来低格nandflash 24 | 25 | `sudo ./upgrade_tool lf #(LF Lowlevel Format)` # will erase everything on nand 26 | 27 | * 烧写 parameter 28 | 29 | `sudo ./upgrade_tool di -p /path/to/parameter` #(DI Download Image) 30 | 31 | * 烧写 bootloader 32 | 33 | `sudo ./upgrade_tool ul /path/to/bootloader` #(UL Upgrade Loader) 34 | 35 | * 烧写内核(boot.img) 36 | 37 | `sudo ./upgrade_tool di -b /path/to/boot.img` #(DI Download Image) 38 | 39 | 40 | 其他 41 | 有一些在upgrade_tool中使用的其他命令,比如: 42 | UL: 升级Loader 43 | EF: 擦除nand flash 44 | 45 | 46 | [1]:/2014/12/31/enter-recovery-mode.html 47 | 48 | [2]:http://dl.radxa.com/rock/tools/linux/Linux_Upgrade_Tool_v1.21.zip 49 | 50 | -------------------------------------------------------------------------------- /_posts/start/2014-12-28-Flash-image-to-nand-windows.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 将image烧写到NAND(Windows) 4 | category: 上手指南 5 | tags: [入门, Flash, image, NAND] 6 | keywords: image,NAND 7 | description: 8 | --- 9 | 10 | >这篇文章描述了windows平台下,如何在Radxa Rock的nand flash上安装镜像,比如,如何烧写开发板。你可以选择烧写整个nand镜像(比如update.img)到开发板或者仅仅烧写选定的分区。你可以从我们的服务器下载prebuilt镜像或者编译你自己的镜像。 11 | 12 | ## 在你开始之前 13 | 14 | 记住: 15 | 16 | ``` 17 | 你可以一直烧写rock,它不会变成板砖,除非一些硬件损坏了。 18 | ``` 19 | 20 | 烧写开发板你需要做的是: 21 | 22 | - Radxa Rock(检查硬件版本,有Pro 和Full/Lite版,固件是不同的) 23 | - 一台电脑windows(win xp 32/64bit,win7 32//64bit或者linux 32/64bit) 24 | - 一个micro USB线-一端插在Radxa Rock的OTG口,另一端插在PC的USB口 25 | 26 | ## windows平台 27 | 28 | 烧写镜像的Windows工具由Rockchip提供。为了烧写update.img,你需要使用RKBath Tool然后烧写到分区,你需要使用RKDevelop Tool。RKBath Tool和RKDevelop Tool依赖于RK USB驱动,所以你需要首先安装一下: 29 | 30 | ### 安装驱动 31 | 32 | 1. 使用RKDriver Assistant tools-这是简单的方式(仅支持winxp,Vista,win7,不支持 win8) 33 | 2. 手动安装(支持winxp,vista,win7,win8) 34 | 35 | 如果你已经安装了USB驱动,请跳过这一步。 36 | 37 | #### a.使用RDKriver Assistant tools 38 | 39 | 注意:这个方式仅支持winxp,vista,win7,不支持win8。 40 | 41 | 在这个过程中仅仅下载和解压[RKDriverAssistant.zip](http://dl.radxa.com/rock/tools/windows/RK_DriverAssitant.zip),没必要连接你的Rockchip设备。然后双击 DriverInstall.exe 启动安装。如果你已经事先已经安装过了Rockchip USB 驱动,请先确保你卸载了。 42 | 43 | ![image](http://radxa.com/mw/images/b/ba/RK_Driver_Assistant_Install_Uninstall.jpg) 44 | 45 | 点击“Install Driver”。当驱动安装完了,然后关掉Radxa开发板,然后连接Radxa Rock到你的电脑,让开发板进入[loder 模式](http://radxa.com/Rock/Loader_mode),然后你的电脑会检测开发板,你会看到它在设备管理器里面了: 46 | 47 | ![image](http://radxa.com/mw/images/2/2a/RK_Driver_Assistant_Install_Usb_driver.png) 48 | 49 | 这时,驱动应该已经成功安装了,恭喜你! 50 | 51 | #### b.手动安装 52 | 53 | 先下载驱动。如果你使用winxp,win7系统,从这里下载[usb_driver_v3.5.zip](http://dl.radxa.com/rock/tools/windows/usb_driver_v3.5.zip)。 win8系统呢,从这里下载[usb_driver_v3.7.zip](http://dl.radxa.com/rock/tools/windows/Rockusb%20Driver%20v3.7.zip)。关闭Radxa Rock开发板,然后连接Radxa Rock到电脑,让开发板进入到loder模式。在你的电脑检测到开发板后,你会看到设备管理器是这样的: 54 | 55 | ![image](http://radxa.com/mw/images/4/44/Flash_image_1.jpg) 56 | 57 | 选择未识别的设备,右击,然后选择“更新软件驱动”。 58 | 59 | ![image](http://radxa.com/mw/images/a/a5/Flash_image_2.jpg) 60 | 61 | 选择“浏览电脑查找驱动” 62 | 63 | ![image](http://radxa.com/mw/images/4/43/Flash_image_2.5.jpg) 64 | 65 | 找到你解压好的驱动文件(usb_driver_v3.5.zip),然后选择32/64位文件夹,然后点击“确定”安装。 66 | 67 | ![image](http://radxa.com/mw/images/e/e9/Flash_image_3.jpg) 68 | 69 | 当驱动正确安装了,你会在设备管理器看到Rock USB设备。 70 | 71 | ![image](http://radxa.com/mw/images/6/66/Flash_image_6.jpg) 72 | 73 | 驱动搞定了! 74 | 75 | ### 烧写镜像 76 | 77 | 有两种方法烧写镜像: 78 | 79 | 1. 使用RKBatch Tool(工厂更新固件工具,只烧写update.img,它会擦出所有的东西) 80 | 2. 使用RKAndroid Tool(开发工具,可以烧写分区) 81 | 82 | #### 使用RKBatch Tool来烧写update.img 83 | 84 | 从[这里](http://dl.radxa.com/rock/tools/windows/RK_BatchTool_V1.7.zip)下载RKbatch Tool。解压并运行RKBatch Tool.exe,你会看到下面的界面: 85 | 86 | ![image](http://radxa.com/mw/images/1/18/Flash_image_7.jpg) 87 | 88 | 选择镜像(rockdev/update.img)。可以查看[这里](http://radxa.com/Rock/update.img)来看如何制作nand 镜像。 89 | 90 | ![image](http://radxa.com/mw/images/c/ca/Flash_image_8.jpg) 91 | 92 | 关闭Radxa Rock开发板,然后将它连接到电脑上,让开发板进入[loder模式][1],此时程序应该检测到了设备。 93 | 94 | ![image](http://radxa.com/mw/images/5/59/Flash_image_9.jpg) 95 | 96 | 点击“Update”按钮开始烧写,当烧写结束,你应该看到下面的界面: 97 | 98 | ![image](http://radxa.com/mw/images/9/9a/Flash_image_10.jpg) 99 | 100 | 如果烧写中断,它会导致update.img出现错误,你可以重新操作以上步骤或者重新制作update.img。 101 | 102 | #### 使用RKAndroid Tool来烧写到分区 103 | 104 | 从[这里](http://dl.radxa.com/rock/tools/windows/RKDevelopTool_v1.37.zip)下载RKAndroid Tool。解压,然后运行RKAndroidTool.exe,你会看到: 105 | 106 | ![image](http://radxa.com/mw/images/2/28/Rkandroidtool_flash_image_1.png) 107 | 108 | 关闭Radxa Rock开发板,然后将它连接到电脑上,让开发板进入loder模式,此时程序应该检测到了设备。 109 | 110 | ![image](http://radxa.com/mw/images/6/6d/Rkandroidtool_flash_image_2.png) 111 | 112 | 有八个选择可以选,所以选择正确的行,然后选中行左侧的复选框。然后你必须点击右侧的列来选择你要烧写的文件。你可以选择一个或者多个文件,然后一次性烧写进去。最终,点击“Run”来开始烧写。 113 | 114 | ![image](http://radxa.com/mw/images/c/ce/Rkandroidtool_flash_image_3.png) 115 | 116 | 如果成功了开发板会从电脑断开,然后启动系统。 117 | 118 | 请注意: 119 | 120 | 1. 当你通过`./mkimage.sh ota`命令打包镜像,内核会在boot.img里面,你应该看[Rock/Android_Build ](http://radxa.com/Rock/Android_Build)得到更多信息。 121 | 2. 你可以按照需求一次性烧写一个或多个镜像。 122 | 123 | ### 常见问题 124 | 125 | #### 问题1: recovery模式下 RKBatchTool 检测不到开发板 126 | 127 | 情景1: 128 | 129 | 我已经手动安装了驱动,并且Recovery模式的USB为PID_310B,“Rockusb device”驱动在Vista上安装成功了,但是RKBatchTool连接不到RK3188的板子,导致无法烧写镜像。 130 | 131 | 解决办法: 132 | 133 | RK3188板通过USB3.0 PMMCIA卡连接到笔记本电脑。这是一个USB2.0到USB3.0的兼容性问题,所以USB3.0端口换成USB 2.0端口,然后RKBatchTool应该可以连接到RK3188板子来烧写镜像了。 134 | 135 | 说明: 136 | 1.Recovery 模式 : USB 设备硬件: VID_2207&PID_310 137 | 138 | 2.引导进Android: USB 设备硬件: VID_2207&PID_0006 139 | 140 | 情景2: 141 | 142 | 驱动安装正常,PC可以识别到设备,确定进入了recovery模式,但是一直BatchTool一直无法识别设备。 143 | 144 | 原因分析:使用了自己从网上下载的刷机工具,比如BatchTool 1.5. 145 | 146 | 解决办法:使用教程中指定的BatchTool工具 147 | 148 | #### 问题2: 烧写失败 149 | 情景1:烧写后,串口打印: 150 | 151 | ``` 152 | DDR Version 1.04 20130517 In DDR3 300MHz Bus Width=32 Col=10 Bank=8 Row=15 CS=2 Die Bus-Width=16 Size=2048MB Memory OK OUT BUILD=====6 SdmmcInit=0 20 F:32 1061 0 0 40 FlashReadRetry error!!,row = fff000 FlashReadRetry error!!,row = fff000 153 | ``` 154 | 同时无法引导。 155 | 156 | 157 | 解决办法: 158 | 159 | 如果烧写失败,尝试在烧写前格式化NandFlash。 160 | 161 | RKAndroidTool - 单击 “Erease IDB”按钮,格式化NandFlash。 162 | RKBatchTool - 单击 “Restore”按钮格式化,然后烧写镜像。 163 | 164 | 情景2: 刷机的时候 遇到 Preparing IDB failed 165 | 这有两种情况 166 | 167 | 1)USB线供电不足,此时建议更换质量好的USB线 或者在进入刷机模式后插上电源 168 | 169 | 2 ) bootloader 版本不同导致,如果你之前刷的固件的bootloader版本是高版本,然后刷回低版本的固件,那么你可能会遇到这个问题。板子这是“变砖”了。。。按照这个 [解砖](/2015/07/20/umbrick-rock.html) 解决它。 170 | 171 | 172 | [1]:/2014/12/31/enter-recovery-mode.html 173 | 174 | -------------------------------------------------------------------------------- /_posts/start/2014-12-29-Q-and-A.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: Q and A 4 | category: 上手指南 5 | tags: [问答] 6 | keywords: Q&A,问答 7 | description: 8 | --- 9 | 10 | >自问自答中。。。 11 | 12 | 13 | ### 1、lubuntu 镜像的密码是什么 14 | 15 | 用户名 rock 密码rock 16 | 用户名 root 密码root 17 | 18 | 如果镜像是由你自己编译的,那么默认用户名是linaro: 19 | 20 | 用户名 linaro 密码 linaro 21 | 22 | ### 2、系统不停重启 23 | 24 | 系统需要用*5V/2A*的电源供电, 单独用usb线供电 25 | 26 | ### 3、突然上电之后 绿色的灯不亮了 网口的绿色灯也不亮了 只有红色的指示灯,是系统没有启动吗? 27 | 28 | 这种问题有几种可能: 29 | 30 | - 是不是刷错了固件. 具体请看 “固件命名原则”的帖子 31 | 32 | - recovery键是不是被外壳压着了 33 | 34 | ### 4、linux下,接上显示器以后桌面显示不全,怎么办? 35 | 36 | RR的默认HDMI输出是1080p,可更换更高分辨率的显示器或设置分辨率 37 | 38 | ### 5、LED怎么控制? 39 | 40 | 在linux下的c、python、shell的设置方法,详见http://wiki.radxa.com/Rock/led 41 | 42 | ### 6、两个扩展口都代表什么,编号是多少? 43 | 44 | 扩展口资料,详见http://wiki.radxa.com/Rock/extension_header 45 | 46 | ### 7、Android的源码哪里下载? 47 | 48 | http://wiki.radxa.com/Rock/Android_Build#Get_the_source_code 49 | 50 | ### 8、 Radxa 项目谁支持? 51 | 52 | Radxa是一个 Tom Cubie和他深圳的朋友创立的初创公司。 53 | 54 | ### 9、 如何接入私有git服务器? 55 | 56 | 你可以在这里: http://dl.radxa.com/rock/source/radxa_rock_android.tar.gz 下载。不需要账号。 57 | 58 | 解压然后运行`git checkout`来得到源码。 59 | 60 | ### 10、如何在linux下安装中文输入法(How to install chinese input methods) 61 | 62 | http://blog.csdn.net/wangpeiyao5566/article/details/41442109 63 | 64 | ### 11、 WiFi模块芯片是什么?它可以作为接入点吗? 65 | 66 | ### 12、 板子尺寸为多少? 67 | 68 | 大小为10x8cm (4"x3.1"),厚度为1.2cm (0.5") 。 69 | 70 | ### 13、音频输入和输出都在80引脚上吗? 71 | 72 | ### 14、 Radxa Rock支持什么视频和音频格式? 73 | 74 | ### 15、 Radxa Rock 有Audio S/PDIF输出,光纤.它是sound 5.1 (7.1)吗? 75 | 76 | ### 16、 Radxa Rock需要什么电源来给RTC(Real-Time Clock)供电? 77 | 78 | ### 17、 为什么Android运行一些APP(Gmail,benchmark antutu)时一直崩溃和重启? 79 | 80 | 可能是供电问题。Radxa需要直流5V/2A。 81 | 82 | ### 18、如何从Ubuntu返回到Android(双系统)? 83 | 84 | 在左下角有个“b2Android”,点击它即可。 85 | 86 | ### 19、 当尝试用`apt-get`命令安装软件,没有空余的空间了怎么办? 87 | 88 | 运行`resize2fs /dev/block/mtd/by-name/linuxroot` 89 | 90 | ### 20、radxa rock/pro/lite android如何实现1080p? 91 | 92 | 1. 删除 out/target/product/rk3188/system/build.prop 93 | 2. 修改 device/rockchip/rksdk/device.mk将其中的video.use.overlay=1 改为 video.use.overlay=0 94 | 3. 重新编译打包 95 | 96 | ### 21、pro上有几个Uart, 最大速率多少? 97 | 98 | 4个, 有一个是串口控制台. 最大传输速率115200 99 | 100 | 101 | 参考: 102 | 103 | 1. http://radxa.com/Rock/FAQ 104 | 2. http://cn.radxa.com/forum.php?mod=viewthread&tid=7&extra=page%3D1 105 | 106 | -------------------------------------------------------------------------------- /_posts/start/2014-12-31-enter-recovery-mode.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 如何进入recovery 模式 4 | category: 上手指南 5 | tags: [recovery,模式] 6 | keywords: redxa,rock,recovery,模式 7 | description: 8 | --- 9 | 10 | 只需要4步 11 | 12 | 1. 断开电源 13 | 2. 拔掉USB线 14 | 3. 长按recovery键 15 | 4. 插入usb线到otg口 16 | 17 | 18 | 此时如何连接有刷机工具(RKBatchTool.exe, RKAndroidTool 或者linux下工具 ) 工具会自动识别设备 19 | 20 | ![image](http://cn.radxa.com/data/attachment/forum/201412/10/115141iab5zgauntihlb0a.jpeg) 21 | -------------------------------------------------------------------------------- /_posts/start/2015-07-17-download-to-sdcard.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 往SD卡中载入启动镜像 4 | category: 上手指南 5 | tags: [产品] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # 烧录ROCK SD卡启动镜像 11 | 12 | 首先要下载或者制作一个从SD卡启动的镜像,下载可以从(http://dl.radxa.com/) 13 | 制作可以参考本github中的其他文档,或者访问Radxa的官网http://radxa.com 14 | **(注意:rock lite从SD卡启动的android镜像只能由Windows平台烧录)** 15 | 16 | ## Windows下操作 17 | 18 | 开始之前,你需要准备一张至少8GB的高质量SD卡,劣质SD卡会导致启动失败(追求质量一向是IT从业者优先考虑的事物) 19 | 20 | * 下载[Win32DiskImager](http://sourceforge.net/projects/win32diskimager/files/latest/download) 21 | * 使用工具将镜像写入SD卡中 22 | ![image](http://radxa.com/mw/images/3/38/Win32DiskImager.png) 23 | 24 | ## Linux 25 | 26 | * 我们使用dd命令将镜像写入SD卡中 27 | `sudo dd if=radxa_rock_xxxx_sdcard.img of=/dev/sdx` 28 | 29 | * 需要注意的是,sdx是SD卡插入PC后,PC自动命名的,所以我们在SD插入前,以及插入后,执行 30 | `ls /dev/sd*` 31 | 通过对比得到SD卡的命名,如果出现sdb,sdb1,sdb2等类似名字,使用sdb。 32 | 33 | * 有时,我们只需要烧录某个分区,并且不想为烧录整个镜像而浪费太多时间,则需要查看该镜像打包时的patamater文件,上面会记录分区的地址。如boot分区 34 | *{ 35 | CMDLINE:console=ttyFIQ0,115200 console=tty0 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init mac_addr=de:ad:de:ad:be:ef initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00008000@0x00002000(boot),-@0x0000A000(linuxroot) 36 | }* 37 | 38 | * 在使用dd命令的时候,则需要加上一个偏移量+0x2000 39 | `sudo dd if=booting.img of=/dev/sdx seek=$(0x2000+0x2000)` 40 | -------------------------------------------------------------------------------- /_posts/start/2015-07-20-unbrick-rock.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Rock变砖了怎么办 4 | category: 上手指南 5 | tags: [砖机] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # 拯救Rock 11 | 12 | 怎样就算是变成砖机? 13 | 14 | 当你使用工具“RKBatch Tool”往rock中写入镜像文件时失败,并且提示信息“Prepare IDB Fail”(或者说使用其他工具显示类似“IDB download failed ”这样的信息),Radxa就是“砖机”。 15 | 16 | 但是实际上,它也不是真的成了一块转头。我们在拯救机器的时候,首先确认没有SD卡插在卡槽中,不然bootloader在这个时候会被破坏。这样,我们就总能恢复rock。 17 | 18 | ## 怎样恢复设备(in windows) 19 | 20 | * 关掉电源 21 | * 把nand的8P和9P短接(使用导电物体连接两个引脚),并且把板子用OTG-USB线连接上PC机。 22 | ![image](http://radxa.com/mw/images/e/ee/7w6fu.png) 23 | * 在连接上电脑之后,就可以把短接的针拿掉。在RKBatch Tool的方框内,现在应该变成蓝色了(如果不是,则重试一次) 24 | * 点击“restore”按钮,然后载入一个update.img的完整镜像。 25 | 26 | ## 提示 27 | 28 | * 你可以使用放大镜或者变焦相机来帮助你完成短接这个步骤 29 | * 针脚的计数开始位置是芯片上有个小圆圈的一侧 30 | 31 | ## In linux 32 | 33 | 同样的操作对板子,连接OTG-USB线之后,使用upgrade_tool工具,会显示类似下面的信息 34 | 35 | > sudo upgrade_tool 36 | List of rockusb connected 37 | No found rockusb,Rescan press ,Quit press :r 38 | List of rockusb connected 39 | DevNo=1 Vid=0x2207,Pid=0x310b,LocationID=21f **Maskrom** 40 | Found 1 rockusb,Select input DevNo,Rescan press ,Quit press :1 41 | Rockusb>uf /tmp/radxa-rock-alip-desktop.img 42 | Loading firmware... 43 | 44 | 当你看见Maskrom(更多时候显示‘Loader’),那就意味着你成功短接了Rock的引脚 45 | 46 | -------------------------------------------------------------------------------- /_posts/start/2015-07-20-upgrade-nand-from-SD.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 从SD卡中向NAND引导镜像 4 | category: 上手指南 5 | tags: [镜像,SD卡] 6 | keywords: radxa 7 | description: 8 | --- 9 | 10 | # 从SD卡中向NAND引导镜像 11 | 12 | **Rockchip提供了在windows下完成这一任务的工具,但是目前只支持用于烧录Android的镜像。Linux下需要做更多的工作** 13 | 14 | 15 | ## WINDOWS 16 | ### 准备设备 17 | 18 | * 一张至少4G的SD卡 19 | * 一个SD读卡器 20 | * windows系统的PC 21 | 22 | ### 先去下载一个升级的镜像文件 23 | 24 | 记住,是android的镜像,你可以从这里下载http://radxa.com 25 | 26 | ### 制作一个用于升级的SD卡 27 | 28 | * 下载工具,并借解压它http://dl.radxa.com/rock/tools/windows/SD_Firmware_Tool.zip 29 | * SD卡插入读卡器,读卡器连接到电脑上 30 | * 在广告下载的工具文件夹中,寻找一个“SD_Firewware_Tool.exe"的文件,然后打开它 31 | * 在”choose removable disk"项中,选择你广告插入的SD卡 32 | * 勾选"upgrade Fireware" 33 | * 选择你想要烧录的镜像文件 34 | * 最后点击”create“按钮。当完成时,会有弹窗提示你。 35 | ![image](http://radxa.com/mw/images/b/bd/Upgrade_disk_1.jpg) 36 | 37 | ### 用SD卡升级Rock 38 | 39 | * 把rock关机 40 | * 插入SD卡 41 | * 启动rock,接着程序运行,你会看见如下的界面 42 | ![image](http://radxa.com/mw/images/0/0d/Upgrade_disk_2.jpg) 43 | * 等待初始华结束,这个过程也许会持续几分钟,当升级成功后,你会看见下面的界面 44 | ![image](http://radxa.com/mw/images/7/73/Upgrade_disk_3.jpg) 45 | * 关闭rock,移除SD卡 46 | * 启动rock,现在系统就是新载入的版本了 47 | 48 | 49 | ## Linux 50 | 51 | * 在Linux操作环境下,你先要往SD卡中载入一个sdboot-header.img,下载地址 http://files.androtab.info/radxa/sdboot.tgz 。 52 | 53 | * 将你的SD卡连接PC,划出一块分区,下列命令中的X,需要读者根据自己SD卡插入后,在/dev/目录下生成的名字替换 54 | `dd if=sdboot-header.img of=/dev/sdX bs=1M conv=fsync` 55 | * 为分区设置文件格式 56 | `mkfs.vfat /dev/sdX1` 57 | * 挂载该分区 58 | `mount /dev/sdX1 /mnt` 59 | * 将我们刚刚下载压缩包内的文件复制进分区中 60 | `cp rksdfw.tag sd_boot_config.config /mnt/` 61 | * 复制你想要升级的镜像文件到该分区,并且名字命令为“sdupdate.img" 62 | `cp path/to/radxa_update.img /mnt/sdupdate.img` 63 | * 取消挂载 64 | `umount /mnt` 65 | 66 | 然后将SD卡插入Rock中,启动即可。 67 | 68 | -------------------------------------------------------------------------------- /_posts/start/2015-07-21-firmware-naming.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 固件命名介绍 4 | category: 上手指南 5 | tags: [入门, Flash, image, NAND] 6 | keywords: image,NAND 7 | description: 8 | --- 9 | 10 | ## update.img 11 | 12 | update.img是一个包含了所有需要部分的升级镜像。也就是说,只要导入这一个镜像文件,就可以达到正常启动系统的目的,当然,这个名字一般用在当你自己编译固件的时候由编译文件自动生成,如果你是从某个地方下载固件的话,一般会有特殊的命名方式。你可以下载完整的update.img在这里http://dl.radxa.com 13 | 14 | ## 如何去下载正确的镜像 15 | 16 | * 首先确认你的板子是什么版本,可以参考这个(http://radxa.com/Rock/hardware_revision) 17 | 18 | * 所有的镜像都可以从这里下载http://dl.radxa.com/ 19 | 20 | * 不一样的板子,你需要到各自的文件夹下寻找镜像。例如,你的板子是rock pro,那么你应该进入类似rock_pro/images/... 21 | 22 | * 镜像的命名是有规律的,你可以通过分析文件名判断是否是你所需要的镜像。例如: 23 | 24 | > radxa_rock_android_kitkat_r2_140911_sdcard.zip 25 | radxa_rock : 硬件的名字 26 | android : 固件的OS 27 | kitkat :固件所特有的别名,android4.4 28 | r2 : 发布版本 29 | 140911 :发布日期 30 | sdcard : 说明镜像是准备用来从SD卡启动的,没有这个名字,则是从nand。 31 | 32 | **注意:不一样版本的硬件,不能使用同一份镜像文件,否则会导致不能启动或者没有视频输出** 33 | 34 | 35 | 36 | ## 创建镜像 37 | 38 | 下面会有一些关于Radxa Rock固件组成的介绍,如果你不感兴趣,或者看不太明白,没关系,可以直接去下面两个链接,学习编译固件的步骤 39 | 40 | [Linux固件编译][1] 41 | 42 | [android固件编译][2] 43 | 44 | 45 | #### Linux固件 46 | 47 | 一个完整可用的Rock固件,需要包含这几个分区,它们可以在打包固件时的package-file文件中查看 48 | 49 | * bootloader 50 | 启动引导程序,Rockchip提供了闭源的多个版本 51 | * boot.img 52 | 这个是由android定义的格式,其中包含了Linux的内核,还有虚拟磁盘的程序 53 | * pagameter 54 | 这个文件的作用在于区分各个分区的位置,我们在使用瑞芯微提供的upgrade_tool工具时,就是根据这个文件的提供的地址去更新擦写分区 55 | * rootfs.img 56 | 文件系统,他也是一个固件占用最大的部分,我们所使用的系统,能被看到的文件,都在这个里面 57 | 58 | 59 | 60 | #### Android固件 61 | 62 | Android是一个基于Linux内核的系统,所以相比于Linux固件,Android会多出几个特有的部分 63 | 64 | * recovery 65 | 由android定义的格式,包含了Linux内核,加上一个用来恢复系统的程序 66 | * misc 67 | 这个分区保存了一些硬件相关的数据,很重要 68 | * data 69 | 用户数据区,程序就是安装在这 70 | * cache 71 | 用户缓存区 72 | * system 73 | 系统的文件存放在这,如果损坏,可以进入recovery分区,重新引导新的固件 74 | 75 | 76 | [1]:/2015/07/17/build-linux-image.html 77 | [2]:/2015/07/17/build-android-source-code.html 78 | -------------------------------------------------------------------------------- /assets/_sass/_animation.scss: -------------------------------------------------------------------------------- 1 | 2 | //------- {{ animation__fadeIn }} -------// 3 | 4 | @-webkit-keyframes fadeIn { 5 | from { 6 | -webkit-transform: translateY(30px); 7 | opacity: 0 8 | } 9 | to { 10 | -webkit-transform: translateY(0); 11 | opacity: 1 12 | } 13 | } 14 | @-moz-keyframes fadeIn { 15 | from { 16 | -moz-transform: translateY(30px); 17 | opacity: 0 18 | } 19 | to { 20 | -moz-transform: translateY(0); 21 | opacity: 1 22 | } 23 | } 24 | @-ms-keyframes fadeIn { 25 | from { 26 | -ms-transform: translateY(30px); 27 | opacity: 0 28 | } 29 | to { 30 | -ms-transform: translateY(0); 31 | opacity: 1 32 | } 33 | } 34 | @-o-keyframes fadeIn { 35 | from { 36 | -o-transform: translateY(30px); 37 | opacity: 0 38 | } 39 | to { 40 | -o-transform: translateY(0); 41 | opacity: 1 42 | } 43 | } 44 | @keyframes fadeIn { 45 | from { 46 | transform: translateY(30px); 47 | opacity: 0 48 | } 49 | to { 50 | transform: translateY(0); 51 | opacity: 1 52 | } 53 | } 54 | 55 | //------- {{ animation__fadeOut }} -------// 56 | 57 | @-webkit-keyframes fadeOut { 58 | from { 59 | -webkit-transform: translateY(0); 60 | opacity: 1 61 | } 62 | to { 63 | -webkit-transform: translateY(-30px); 64 | opacity: 0 65 | } 66 | } 67 | @-moz-keyframes fadeOut { 68 | from { 69 | -moz-transform: translateY(0); 70 | opacity: 1 71 | } 72 | to { 73 | -moz-transform: translateY(-30px); 74 | opacity: 0 75 | } 76 | } 77 | @-ms-keyframes fadeOut { 78 | from { 79 | -ms-transform: translateY(0); 80 | opacity: 1 81 | } 82 | to { 83 | -ms-transform: translateY(-30px); 84 | opacity: 0 85 | } 86 | } 87 | @-o-keyframes fadeOut { 88 | from { 89 | -o-transform: translateY(0); 90 | opacity: 1 91 | } 92 | to { 93 | -o-transform: translateY(-30px); 94 | opacity: 0 95 | } 96 | } 97 | @keyframes fadeOut { 98 | from { 99 | transform: translateY(0); 100 | opacity: 1 101 | } 102 | to { 103 | transform: translateY(-30px); 104 | opacity: 0 105 | } 106 | } 107 | 108 | //------- {{ animation__flash }} -------// 109 | 110 | @-webkit-keyframes flash { 111 | from, to { 112 | color: inherit; 113 | -webkit-transform: translateX(0); 114 | } 115 | 35% { 116 | color: $flash; 117 | -webkit-transform: translateX(-.75em); 118 | } 119 | } 120 | @-moz-keyframes flash { 121 | from, to { 122 | color: inherit; 123 | -moz-transform: translateX(0); 124 | } 125 | 35% { 126 | color: $flash; 127 | -moz-transform: translateX(-.75em); 128 | } 129 | } 130 | @-ms-keyframes flash { 131 | from, to { 132 | color: inherit; 133 | -ms-transform: translateX(0); 134 | } 135 | 35% { 136 | color: $flash; 137 | -ms-transform: translateX(-.75em); 138 | } 139 | } 140 | @-o-keyframes flash { 141 | from, to { 142 | color: inherit; 143 | -o-transform: translateX(0); 144 | } 145 | 35% { 146 | color: $flash; 147 | -o-transform: translateX(-.75em); 148 | } 149 | } 150 | @keyframes flash { 151 | from, to { 152 | color: inherit; 153 | transform: translateX(0);; 154 | } 155 | 35% { 156 | color: $flash; 157 | transform: translateX(-.75em); 158 | } 159 | } 160 | 161 | //------- {{ animation__spin }} -------// 162 | 163 | @-webkit-keyframes spin { 164 | from { 165 | -webkit-transform: rotate(0deg); 166 | } 167 | to { 168 | -webkit-transform: rotate(359deg); 169 | } 170 | } 171 | @-moz-keyframes spin { 172 | from { 173 | -moz-transform: rotate(0deg); 174 | } 175 | to { 176 | -moz-transform: rotate(359deg); 177 | } 178 | } 179 | @-o-keyframes spin { 180 | from { 181 | -o-transform: rotate(0deg); 182 | } 183 | to { 184 | -o-transform: rotate(359deg); 185 | } 186 | } 187 | @-ms-keyframes spin { 188 | from { 189 | -ms-transform: rotate(0deg); 190 | } 191 | to { 192 | -ms-transform: rotate(359deg); 193 | } 194 | } 195 | @keyframes spin { 196 | from { 197 | transform: rotate(0deg); 198 | } 199 | to { 200 | transform: rotate(359deg); 201 | } 202 | } 203 | 204 | 205 | -------------------------------------------------------------------------------- /assets/_sass/_nprogress.scss: -------------------------------------------------------------------------------- 1 | /* Make clicks pass-through */ 2 | /* Modified by Peiwen Lu @ 06 Nov 2013 */ 3 | 4 | #nprogress { 5 | pointer-events: none; 6 | -webkit-pointer-events: none; 7 | } 8 | 9 | #nprogress .bar { 10 | background: $nprogress; 11 | 12 | position: fixed; 13 | z-index: 100; 14 | top: 0; 15 | left: 0; 16 | 17 | width: 100%; 18 | height: 2px; 19 | } 20 | 21 | /* Fancy blur effect */ 22 | #nprogress .peg { 23 | display: block; 24 | position: absolute; 25 | right: 0px; 26 | width: 100px; 27 | height: 100%; 28 | box-shadow: 0 0 10px $nprogress, 0 0 5px $nprogress; 29 | opacity: 1.0; 30 | 31 | -webkit-transform: rotate(3deg) translate(0px, -4px); 32 | -moz-transform: rotate(3deg) translate(0px, -4px); 33 | -ms-transform: rotate(3deg) translate(0px, -4px); 34 | -o-transform: rotate(3deg) translate(0px, -4px); 35 | transform: rotate(3deg) translate(0px, -4px); 36 | } 37 | 38 | /* Remove these to get rid of the spinner */ 39 | #nprogress .spinner { 40 | display: block; 41 | position: fixed; 42 | z-index: 100; 43 | @extend %fixed-btn-positon; 44 | @media screen and (max-width: $sidebar-width) { 45 | top: 5px; 46 | right: 5px; 47 | } 48 | } 49 | 50 | #nprogress .spinner-icon { 51 | @extend %fixed-btn-size; 52 | 53 | border: solid 2px transparent; 54 | border-top-color: $nprogress; 55 | border-left-color: $nprogress; 56 | border-radius: 50%; 57 | 58 | -webkit-animation: spin 400ms linear infinite; 59 | -moz-animation: spin 400ms linear infinite; 60 | -ms-animation: spin 400ms linear infinite; 61 | -o-animation: spin 400ms linear infinite; 62 | animation: spin 400ms linear infinite; 63 | } 64 | 65 | 66 | // @-webkit-keyframes nprogress-spinner { 67 | // 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 68 | // 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } 69 | // } 70 | // @-moz-keyframes nprogress-spinner { 71 | // 0% { -moz-transform: rotate(0deg); transform: rotate(0deg); } 72 | // 100% { -moz-transform: rotate(360deg); transform: rotate(360deg); } 73 | // } 74 | // @-o-keyframes nprogress-spinner { 75 | // 0% { -o-transform: rotate(0deg); transform: rotate(0deg); } 76 | // 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } 77 | // } 78 | // @-ms-keyframes nprogress-spinner { 79 | // 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } 80 | // 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } 81 | // } 82 | // @keyframes nprogress-spinner { 83 | // 0% { transform: rotate(0deg); transform: rotate(0deg); } 84 | // 100% { transform: rotate(360deg); transform: rotate(360deg); } 85 | // } 86 | -------------------------------------------------------------------------------- /assets/_sass/_pygments.scss: -------------------------------------------------------------------------------- 1 | /*!------------------------------------- 2 | * Syntax Colours 3 | * https://gist.github.com/edwardhotchkiss/2005058 4 | * 5 | * Theme based on prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML 6 | * @author Tim Shedor 7 | * ------------------------------------- */ 8 | 9 | /*! Modified by Peiwen Lu @ 30 Nov 2013 */ 10 | 11 | /* Code blocks */ 12 | .highlight { 13 | margin: 1.715em 0; 14 | } 15 | 16 | pre { 17 | padding: 1em; 18 | font: .9em/1.5 Consolas, Monaco, 'Andale Mono', monospace; 19 | border: 1px solid $pygments-bd; 20 | border-radius: 3px; 21 | background-color: $pygments-even; 22 | background-image: -webkit-linear-gradient(transparent 50%, $pygments-odd 50%); 23 | background-image: -moz-linear-gradient(transparent 50%, $pygments-odd 50%); 24 | background-image: -ms-linear-gradient(transparent 50%, $pygments-odd 50%); 25 | background-image: -o-linear-gradient(transparent 50%, $pygments-odd 50%); 26 | background-image: linear-gradient(transparent 50%, $pygments-odd 50%); 27 | background-size: 3em 3em; 28 | background-origin: content-box; 29 | overflow: auto; 30 | -webkit-overflow-scrolling: touch; 31 | // max-height: 30em; 32 | &::-webkit-scrollbar { 33 | height: 7px; 34 | } 35 | &::-webkit-scrollbar-thumb { 36 | background: $border; 37 | &:hover { 38 | background: darken($border, 5%); 39 | } 40 | } 41 | } 42 | 43 | pre > code { 44 | font-family: inherit; 45 | direction: ltr; 46 | text-align: left; 47 | white-space: pre; 48 | word-spacing: normal; 49 | 50 | -moz-tab-size: 4; 51 | -o-tab-size: 4; 52 | tab-size: 4; 53 | 54 | -webkit-hyphens: none; 55 | -moz-hyphens: none; 56 | -ms-hyphens: none; 57 | hyphens: none; 58 | } 59 | 60 | /* Inline code */ 61 | :not(pre) > code { 62 | padding: .25em .5em .1em; 63 | color: $inline-code-fg; 64 | font: .85em Consolas, Monaco, 'Andale Mono', monospace; 65 | background: $inline-code-bg; 66 | border: 1px solid $inline-code-bd; 67 | border-radius: .25em; 68 | vertical-align: 2px; 69 | } 70 | 71 | .highlight .c { color: #586E75 } /* Comment */ 72 | .highlight .err { color: #93A1A1 } /* Error */ 73 | .highlight .g { color: #93A1A1 } /* Generic */ 74 | .highlight .k { color: #859900 } /* Keyword */ 75 | .highlight .l { color: #93A1A1 } /* Literal */ 76 | .highlight .n { color: #93A1A1 } /* Name */ 77 | .highlight .o { color: #859900 } /* Operator */ 78 | .highlight .x { color: #CB4B16 } /* Other */ 79 | .highlight .p { color: #93A1A1 } /* Punctuation */ 80 | .highlight .cm { color: #586E75 } /* Comment.Multiline */ 81 | .highlight .cp { color: #859900 } /* Comment.Preproc */ 82 | .highlight .c1 { color: #586E75 } /* Comment.Single */ 83 | .highlight .cs { color: #859900 } /* Comment.Special */ 84 | .highlight .gd { color: #2AA198 } /* Generic.Deleted */ 85 | .highlight .ge { color: #93A1A1; font-style: italic } /* Generic.Emph */ 86 | .highlight .gr { color: #DC322F } /* Generic.Error */ 87 | .highlight .gh { color: #CB4B16 } /* Generic.Heading */ 88 | .highlight .gi { color: #859900 } /* Generic.Inserted */ 89 | .highlight .go { color: #93A1A1 } /* Generic.Output */ 90 | .highlight .gp { color: #93A1A1 } /* Generic.Prompt */ 91 | .highlight .gs { color: #93A1A1; font-weight: bold } /* Generic.Strong */ 92 | .highlight .gu { color: #CB4B16 } /* Generic.Subheading */ 93 | .highlight .gt { color: #93A1A1 } /* Generic.Traceback */ 94 | .highlight .kc { color: #CB4B16 } /* Keyword.Constant */ 95 | .highlight .kd { color: #268BD2 } /* Keyword.Declaration */ 96 | .highlight .kn { color: #859900 } /* Keyword.Namespace */ 97 | .highlight .kp { color: #859900 } /* Keyword.Pseudo */ 98 | .highlight .kr { color: #268BD2 } /* Keyword.Reserved */ 99 | .highlight .kt { color: #DC322F } /* Keyword.Type */ 100 | .highlight .ld { color: #93A1A1 } /* Literal.Date */ 101 | .highlight .m { color: #2AA198 } /* Literal.Number */ 102 | .highlight .s { color: #2AA198 } /* Literal.String */ 103 | .highlight .na { color: #93A1A1 } /* Name.Attribute */ 104 | .highlight .nb { color: #B58900 } /* Name.Builtin */ 105 | .highlight .nc { color: #268BD2 } /* Name.Class */ 106 | .highlight .no { color: #CB4B16 } /* Name.Constant */ 107 | .highlight .nd { color: #268BD2 } /* Name.Decorator */ 108 | .highlight .ni { color: #CB4B16 } /* Name.Entity */ 109 | .highlight .ne { color: #CB4B16 } /* Name.Exception */ 110 | .highlight .nf { color: #268BD2 } /* Name.Function */ 111 | .highlight .nl { color: #93A1A1 } /* Name.Label */ 112 | .highlight .nn { color: #93A1A1 } /* Name.Namespace */ 113 | .highlight .nx { color: #555 } /* Name.Other */ 114 | .highlight .py { color: #93A1A1 } /* Name.Property */ 115 | .highlight .nt { color: #268BD2 } /* Name.Tag */ 116 | .highlight .nv { color: #268BD2 } /* Name.Variable */ 117 | .highlight .ow { color: #859900 } /* Operator.Word */ 118 | .highlight .w { color: #93A1A1 } /* Text.Whitespace */ 119 | .highlight .mf { color: #2AA198 } /* Literal.Number.Float */ 120 | .highlight .mh { color: #2AA198 } /* Literal.Number.Hex */ 121 | .highlight .mi { color: #2AA198 } /* Literal.Number.Integer */ 122 | .highlight .mo { color: #2AA198 } /* Literal.Number.Oct */ 123 | .highlight .sb { color: #586E75 } /* Literal.String.Backtick */ 124 | .highlight .sc { color: #2AA198 } /* Literal.String.Char */ 125 | .highlight .sd { color: #93A1A1 } /* Literal.String.Doc */ 126 | .highlight .s2 { color: #2AA198 } /* Literal.String.Double */ 127 | .highlight .se { color: #CB4B16 } /* Literal.String.Escape */ 128 | .highlight .sh { color: #93A1A1 } /* Literal.String.Heredoc */ 129 | .highlight .si { color: #2AA198 } /* Literal.String.Interpol */ 130 | .highlight .sx { color: #2AA198 } /* Literal.String.Other */ 131 | .highlight .sr { color: #DC322F } /* Literal.String.Regex */ 132 | .highlight .s1 { color: #2AA198 } /* Literal.String.Single */ 133 | .highlight .ss { color: #2AA198 } /* Literal.String.Symbol */ 134 | .highlight .bp { color: #268BD2 } /* Name.Builtin.Pseudo */ 135 | .highlight .vc { color: #268BD2 } /* Name.Variable.Class */ 136 | .highlight .vg { color: #268BD2 } /* Name.Variable.Global */ 137 | .highlight .vi { color: #268BD2 } /* Name.Variable.Instance */ 138 | .highlight .il { color: #2AA198 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /assets/font/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fontello", 3 | "css_prefix_text": "icon-", 4 | "css_use_suffix": false, 5 | "hinting": true, 6 | "units_per_em": 1000, 7 | "ascent": 850, 8 | "glyphs": [ 9 | { 10 | "uid": "bf882b30900da12fca090d9796bc3030", 11 | "css": "mail", 12 | "code": 59392, 13 | "src": "fontawesome" 14 | }, 15 | { 16 | "uid": "72b1277834cba5b7944b0a6cac7ddb0d", 17 | "css": "rss", 18 | "code": 59394, 19 | "src": "fontawesome" 20 | }, 21 | { 22 | "uid": "37f6cfbb4062ed0d01b351ec35c334ff", 23 | "css": "right-open-mini", 24 | "code": 59398, 25 | "src": "entypo" 26 | }, 27 | { 28 | "uid": "884cfc3e6e2d456dd2a2ca0dbb9e6337", 29 | "css": "left-open-big", 30 | "code": 59393, 31 | "src": "entypo" 32 | }, 33 | { 34 | "uid": "4a413ef43c364dafa42766e74c31bbca", 35 | "css": "cc", 36 | "code": 59395, 37 | "src": "entypo" 38 | }, 39 | { 40 | "uid": "d090355c31f497b61d676416c1fd39fb", 41 | "css": "twitter", 42 | "code": 59397, 43 | "src": "entypo" 44 | }, 45 | { 46 | "uid": "d1945696d6bbbf84e388df9961f26a37", 47 | "css": "sina-weibo", 48 | "code": 59396, 49 | "src": "entypo" 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /assets/font/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/assets/font/fontello.eot -------------------------------------------------------------------------------- /assets/font/fontello.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Copyright (C) 2013 by original authors @ fontello.com 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /assets/font/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/assets/font/fontello.ttf -------------------------------------------------------------------------------- /assets/font/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/assets/font/fontello.woff -------------------------------------------------------------------------------- /assets/js/nprogress.js: -------------------------------------------------------------------------------- 1 | /*! NProgress (c) 2013, Rico Sta. Cruz 2 | * http://ricostacruz.com/nprogress */ 3 | 4 | ;(function(factory) { 5 | 6 | if (typeof module === 'function') { 7 | module.exports = factory(this.jQuery || require('jquery')); 8 | } else if (typeof define === 'function' && define.amd) { 9 | define(['jquery'], function($) { 10 | return factory($); 11 | }); 12 | } else { 13 | this.NProgress = factory(this.jQuery); 14 | } 15 | 16 | })(function($) { 17 | var NProgress = {}; 18 | 19 | NProgress.version = '0.1.2'; 20 | 21 | var Settings = NProgress.settings = { 22 | minimum: 0.08, 23 | easing: 'ease', 24 | positionUsing: '', 25 | speed: 200, 26 | trickle: true, 27 | trickleRate: 0.02, 28 | trickleSpeed: 800, 29 | showSpinner: true, 30 | template: '
    ' 31 | }; 32 | 33 | /** 34 | * Updates configuration. 35 | * 36 | * NProgress.configure({ 37 | * minimum: 0.1 38 | * }); 39 | */ 40 | NProgress.configure = function(options) { 41 | $.extend(Settings, options); 42 | return this; 43 | }; 44 | 45 | /** 46 | * Last number. 47 | */ 48 | 49 | NProgress.status = null; 50 | 51 | /** 52 | * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. 53 | * 54 | * NProgress.set(0.4); 55 | * NProgress.set(1.0); 56 | */ 57 | 58 | NProgress.set = function(n) { 59 | var started = NProgress.isStarted(); 60 | 61 | n = clamp(n, Settings.minimum, 1); 62 | NProgress.status = (n === 1 ? null : n); 63 | 64 | var $progress = NProgress.render(!started), 65 | $bar = $progress.find('[role="bar"]'), 66 | speed = Settings.speed, 67 | ease = Settings.easing; 68 | 69 | $progress[0].offsetWidth; /* Repaint */ 70 | 71 | $progress.queue(function(next) { 72 | // Set positionUsing if it hasn't already been set 73 | if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); 74 | 75 | // Add transition 76 | $bar.css(barPositionCSS(n, speed, ease)); 77 | 78 | if (n === 1) { 79 | // Fade out 80 | $progress.css({ transition: 'none', opacity: 1 }); 81 | $progress[0].offsetWidth; /* Repaint */ 82 | 83 | setTimeout(function() { 84 | $progress.css({ transition: 'all '+speed+'ms linear', opacity: 0 }); 85 | setTimeout(function() { 86 | NProgress.remove(); 87 | next(); 88 | }, speed); 89 | }, speed); 90 | } else { 91 | setTimeout(next, speed); 92 | } 93 | }); 94 | 95 | return this; 96 | }; 97 | 98 | NProgress.isStarted = function() { 99 | return typeof NProgress.status === 'number'; 100 | }; 101 | 102 | /** 103 | * Shows the progress bar. 104 | * This is the same as setting the status to 0%, except that it doesn't go backwards. 105 | * 106 | * NProgress.start(); 107 | * 108 | */ 109 | NProgress.start = function() { 110 | if (!NProgress.status) NProgress.set(0); 111 | 112 | var work = function() { 113 | setTimeout(function() { 114 | if (!NProgress.status) return; 115 | NProgress.trickle(); 116 | work(); 117 | }, Settings.trickleSpeed); 118 | }; 119 | 120 | if (Settings.trickle) work(); 121 | 122 | return this; 123 | }; 124 | 125 | /** 126 | * Hides the progress bar. 127 | * This is the *sort of* the same as setting the status to 100%, with the 128 | * difference being `done()` makes some placebo effect of some realistic motion. 129 | * 130 | * NProgress.done(); 131 | * 132 | * If `true` is passed, it will show the progress bar even if its hidden. 133 | * 134 | * NProgress.done(true); 135 | */ 136 | 137 | NProgress.done = function(force) { 138 | if (!force && !NProgress.status) return this; 139 | 140 | return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); 141 | }; 142 | 143 | /** 144 | * Increments by a random amount. 145 | */ 146 | 147 | NProgress.inc = function(amount) { 148 | var n = NProgress.status; 149 | 150 | if (!n) { 151 | return NProgress.start(); 152 | } else { 153 | if (typeof amount !== 'number') { 154 | amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95); 155 | } 156 | 157 | n = clamp(n + amount, 0, 0.994); 158 | return NProgress.set(n); 159 | } 160 | }; 161 | 162 | NProgress.trickle = function() { 163 | return NProgress.inc(Math.random() * Settings.trickleRate); 164 | }; 165 | 166 | /** 167 | * Waits for all supplied jQuery promises and 168 | * increases the progress as the promises resolve. 169 | * 170 | * @param $promise jQUery Promise 171 | */ 172 | (function() { 173 | var initial = 0, current = 0; 174 | 175 | NProgress.promise = function($promise) { 176 | if (!$promise || $promise.state() == "resolved") { 177 | return this; 178 | } 179 | 180 | if (current == 0) { 181 | NProgress.start(); 182 | } 183 | 184 | initial++; 185 | current++; 186 | 187 | $promise.always(function() { 188 | current--; 189 | if (current == 0) { 190 | initial = 0; 191 | NProgress.done(); 192 | } else { 193 | NProgress.set((initial - current) / initial); 194 | } 195 | }); 196 | 197 | return this; 198 | }; 199 | 200 | })(); 201 | 202 | /** 203 | * (Internal) renders the progress bar markup based on the `template` 204 | * setting. 205 | */ 206 | 207 | NProgress.render = function(fromStart) { 208 | if (NProgress.isRendered()) return $("#nprogress"); 209 | $('html').addClass('nprogress-busy'); 210 | 211 | var $el = $("
    ") 212 | .html(Settings.template); 213 | 214 | var perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0); 215 | 216 | $el.find('[role="bar"]').css({ 217 | transition: 'all 0 linear', 218 | transform: 'translate3d('+perc+'%,0,0)' 219 | }); 220 | 221 | if (!Settings.showSpinner) 222 | $el.find('[role="spinner"]').remove(); 223 | 224 | $el.appendTo(document.body); 225 | 226 | return $el; 227 | }; 228 | 229 | /** 230 | * Removes the element. Opposite of render(). 231 | */ 232 | 233 | NProgress.remove = function() { 234 | $('html').removeClass('nprogress-busy'); 235 | $('#nprogress').remove(); 236 | }; 237 | 238 | /** 239 | * Checks if the progress bar is rendered. 240 | */ 241 | 242 | NProgress.isRendered = function() { 243 | return ($("#nprogress").length > 0); 244 | }; 245 | 246 | /** 247 | * Determine which positioning CSS rule to use. 248 | */ 249 | 250 | NProgress.getPositioningCSS = function() { 251 | // Sniff on document.body.style 252 | var bodyStyle = document.body.style; 253 | 254 | // Sniff prefixes 255 | var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : 256 | ('MozTransform' in bodyStyle) ? 'Moz' : 257 | ('msTransform' in bodyStyle) ? 'ms' : 258 | ('OTransform' in bodyStyle) ? 'O' : ''; 259 | 260 | if (vendorPrefix + 'Perspective' in bodyStyle) { 261 | // Modern browsers with 3D support, e.g. Webkit, IE10 262 | return 'translate3d'; 263 | } else if (vendorPrefix + 'Transform' in bodyStyle) { 264 | // Browsers without 3D support, e.g. IE9 265 | return 'translate'; 266 | } else { 267 | // Browsers without translate() support, e.g. IE7-8 268 | return 'margin'; 269 | } 270 | }; 271 | 272 | /** 273 | * Helpers 274 | */ 275 | 276 | function clamp(n, min, max) { 277 | if (n < min) return min; 278 | if (n > max) return max; 279 | return n; 280 | } 281 | 282 | /** 283 | * (Internal) converts a percentage (`0..1`) to a bar translateX 284 | * percentage (`-100%..0%`). 285 | */ 286 | 287 | function toBarPerc(n) { 288 | return (-1 + n) * 100; 289 | } 290 | 291 | 292 | /** 293 | * (Internal) returns the correct CSS for changing the bar's 294 | * position given an n percentage, and speed and ease from Settings 295 | */ 296 | 297 | function barPositionCSS(n, speed, ease) { 298 | var barCSS; 299 | 300 | if (Settings.positionUsing === 'translate3d') { 301 | barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; 302 | } else if (Settings.positionUsing === 'translate') { 303 | barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; 304 | } else { 305 | barCSS = { 'margin-left': toBarPerc(n)+'%' }; 306 | } 307 | 308 | barCSS.transition = 'all '+speed+'ms '+ease; 309 | 310 | return barCSS; 311 | } 312 | 313 | return NProgress; 314 | }); 315 | 316 | -------------------------------------------------------------------------------- /assets/js/script.js: -------------------------------------------------------------------------------- 1 | 2 | /*!--------------------------------*\ 3 | 3-Jekyll Theme 4 | @author Peiwen Lu (P233) 5 | https://github.com/P233/3-Jekyll 6 | \*---------------------------------*/ 7 | 8 | // Detect window size, if less than 1280px add class 'mobile' to sidebar therefore it will be auto hide when trigger the pjax request in small screen devices. 9 | if ($(window).width() <= 1280) { 10 | $('#sidebar').addClass('mobile') 11 | } 12 | 13 | // Variables 14 | var sidebar = $('#sidebar'), 15 | container = $('#post'), 16 | content = $('#pjax'), 17 | button = $('#icon-arrow'); 18 | 19 | // Tags switcher 20 | var clickHandler = function(id) { 21 | return function() { 22 | $(this).addClass('active').siblings().removeClass('active'); 23 | $('.pl__all').hide(); 24 | $('.' + id).delay(50).fadeIn(350); 25 | } 26 | }; 27 | 28 | $('#tags__ul li').each(function(index){ 29 | $('#' + $(this).attr('id')).on('click', clickHandler($(this).attr('id'))); 30 | }); 31 | 32 | // If sidebar has class 'mobile', hide it after clicking. 33 | $('.pl__all').on('click', function() { 34 | $(this).addClass('active').siblings().removeClass('active'); 35 | if (sidebar.hasClass('mobile')) { 36 | $('#sidebar, #pjax, #icon-arrow').addClass('fullscreen'); 37 | } 38 | }); 39 | 40 | // Enable fullscreen. 41 | $('#js-fullscreen').on('click', function() { 42 | if (button.hasClass('fullscreen')) { 43 | sidebar.removeClass('fullscreen'); 44 | button.removeClass('fullscreen'); 45 | content.delay(300).queue(function(){ 46 | $(this).removeClass('fullscreen').dequeue(); 47 | }); 48 | } else { 49 | sidebar.addClass('fullscreen'); 50 | button.addClass('fullscreen'); 51 | content.delay(200).queue(function(){ 52 | $(this).addClass('fullscreen').dequeue(); 53 | }); 54 | } 55 | }); 56 | 57 | $('#mobile-avatar').on('click', function(){ 58 | $('#sidebar, #pjax, #icon-arrow').addClass('fullscreen'); 59 | }); 60 | 61 | // Pjax 62 | $(document).pjax('#avatar, #mobile-avatar, .pl__all', '#pjax', { fragment: '#pjax', timeout: 10000 }); 63 | $(document).on({ 64 | 'pjax:click': function() { 65 | content.removeClass('fadeIn').addClass('fadeOut'); 66 | NProgress.start(); 67 | }, 68 | 'pjax:start': function() { 69 | content.css({'opacity':0}); 70 | }, 71 | 'pjax:end': function() { 72 | NProgress.done(); 73 | container.scrollTop(0); 74 | content.css({'opacity':1}).removeClass('fadeOut').addClass('fadeIn'); 75 | afterPjax(); 76 | } 77 | }); 78 | 79 | // Re-run scripts for post content after pjax 80 | function afterPjax() { 81 | // Open links in new tab 82 | $('#post__content a').attr('target','_blank'); 83 | 84 | // Generate post TOC for h1 h2 and h3 85 | var toc = $('#post__toc-ul'); 86 | // Empty TOC and generate an entry for h1 87 | toc.empty().append('
  • ' + $('#post__title').text() + '
  • '); 88 | 89 | // Generate entries for h2 and h3 90 | $('#post__content').children('h2,h3').each(function() { 91 | // Generate random ID for each heading 92 | $(this).attr('id', function() { 93 | var ID = "", 94 | alphabet = "abcdefghijklmnopqrstuvwxyz"; 95 | 96 | for(var i=0; i < 5; i++) { 97 | ID += alphabet.charAt(Math.floor(Math.random() * alphabet.length)); 98 | } 99 | return ID; 100 | }); 101 | 102 | if ($(this).prop("tagName") == 'H2') { 103 | toc.append('
  • ' + $(this).text() + '
  • '); 104 | } else { 105 | toc.append('
  • ' + $(this).text() + '
  • '); 106 | } 107 | }); 108 | 109 | // Smooth scrolling 110 | $('.js-anchor-link').on('click', function() { 111 | var target = $(this.hash); 112 | container.animate({scrollTop: target.offset().top + container.scrollTop() - 70}, 500, function() { 113 | target.addClass('flash').delay(700).queue(function() { 114 | $(this).removeClass('flash').dequeue(); 115 | }); 116 | }); 117 | }); 118 | 119 | // Lazy Loading Disqus 120 | // http://jsfiddle.net/dragoncrew/SHGwe/1/ 121 | var ds_loaded = false, 122 | top = $('#disqus_thread').offset().top; 123 | window.disqus_shortname = $('#disqus_thread').attr('name'); 124 | 125 | function check() { 126 | if ( !ds_loaded && container.scrollTop() + container.height() > top ) { 127 | $.ajax({ 128 | type: 'GET', 129 | url: 'http://' + disqus_shortname + '.disqus.com/embed.js', 130 | dataType: 'script', 131 | cache: true 132 | }); 133 | ds_loaded = true; 134 | } 135 | }check(); 136 | container.scroll(check); 137 | }afterPjax(); 138 | 139 | -------------------------------------------------------------------------------- /ie.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Not support IE9 and below 6 | 7 | 8 | 29 | 30 | 31 |

    !

    32 |

    Not support IE9 and below

    33 |

    Recommend to use Chrome or Firefox as your primary browser.

    34 | 35 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 首页 4 | --- 5 | 6 |
    7 |
    8 |
    9 |
    10 |
    {{ site.locals.newest }}
    11 | {% for post in paginator.posts %} 12 | 13 | {{post.title}} 14 | {{ post.date | date:"%Y年%m月%d日" }} 15 | 16 | {% endfor %} 17 |
    18 |
    19 | {% for cate in site.cates %} 20 |
    21 |
    22 |
    {{ cate }}
    23 | {% for tag in site.tags %} 24 | {% if tag[0] == cate %} 25 | {% for post in tag[1] %} 26 | 27 | {{post.title}} 28 | {{ post.date | date:"%Y%m月%d日" }} 29 | 30 | {% endfor %} 31 | {% endif %} 32 | {% endfor %} 33 |
    34 |
    35 | {% endfor %} 36 |
    37 | 38 | -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Welcome to Radxa Documents 4 | --- 5 | 6 | # 新手入门 7 | 8 | 如果你是刚接触Radxa Rock的朋友,建议先看一看下面的几篇文档,我相信,会很有帮助的。 9 | 10 | * [也许你应该会想要知道,你手上的是一个什么好东西](http://docs.radxa.us/2014/12/29/products.html) 11 | 12 | * [先要确定你的开发板是哪个版本](http://docs.radxa.us/2015/07/21/product-history.html) 13 | 14 | * [如何获取可刷机的镜像](http://docs.radxa.us/2015/07/21/firmware-naming.html) 15 | 16 | * [windows往板子中刷入第一个系统](http://docs.radxa.us/2014/12/28/Flash-image-to-nand-windows.html) 17 | 18 | * [Linux往板子中刷入第一个系统](http://docs.radxa.us/2014/12/28/Flash-image-to-nand-linux.html) 19 | 20 | * [新手使用时,总会有这个那个毛病,你可以先看看这有没有你需要的答案](http://docs.radxa.us/2014/12/29/Q-and-A.html) 21 | 22 | # Android开发 23 | 24 | android平台已经得到越来越广的使用 25 | 26 | * [android开发,首先应该知道如何编译一个android固件](http://docs.radxa.us/2015/07/17/build-android-source-code.html) 27 | 28 | * [windows下烧录固件](http://kevinxiasx.github.io/2014/12/28/Flash-image-to-nand-windows.html),[linux下烧录固件](http://docs.radxa.us/2014/12/28/Flash-image-to-nand-linux.html) 29 | 30 | * [然后你会需要ADB调试工具去调试你的设备](http://docs.radxa.us/2015/07/17/install-adb.html) 31 | 32 | * [在安装ADB时,出现问题的概率还是蛮高的,你可以看看这](http://docs.radxa.us/2015/07/22/adb-trouble-shooting.html) 33 | 34 | * [我们还提供了一些android开始时的小技巧,一起来交流吧](http://docs.radxa.us/2015/07/20/android-dev-tips.html) 35 | 36 | # Linux开发请看 37 | 38 | Linux作为一个开源系统,仍将火热不少年头。更多的文档信息可以点击左侧的"linux开发" 39 | 40 | * [老规矩,先编译一个属于你自己的linux固件](http://docs.radxa.us/2015/07/17/build-linux-image.html) 41 | 42 | * [windows下烧录固件](http://kevinxiasx.github.io/2014/12/28/Flash-image-to-nand-windows.html),[linux下烧录固件](http://docs.radxa.us/2014/12/28/Flash-image-to-nand-linux.html) 43 | 44 | * [如果你希望你固件的内核版本更高一些,看看这](http://docs.radxa.us/2015/07/17/build-mainline-kernel.html) 45 | 46 | 47 | # 硬件相关操作 48 | 49 | 当操作Rock上的硬件设备,或者把Rock连接到各式各样的设备上时,你可以看看这 50 | 51 | * [如果想要利用遥控器来控制设备,你需要看看如何使用红外设备](http://docs.radxa.us/2015/07/18/infrared-configuration.html) 52 | 53 | * [如何控制rock上面的LED灯](http://docs.radxa.us/2015/01/06/control-led-with-gpio.html) 54 | 55 | * [调整HDMI显示的分辨率](http://docs.radxa.us/2015/05/17/custom-HDMI-resolution.html) 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /pages/about.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 关于 4 | --- 5 | 6 |

    关于Radxa Documents

    7 | 8 |

    用来汇总raxda的相关资料。

    9 | 10 | 11 |
    12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /pages/archive.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 归档 4 | comments: false 5 | --- 6 | 7 | {% for post in site.posts %} 8 | {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} 9 | {% capture this_month %}{{ post.date | date: "%m" }}{% endcapture %} 10 | {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} 11 | {% capture next_month %}{{ post.previous.date | date: "%m" }}{% endcapture %} 12 | 13 | {% if forloop.first %} 14 | {{this_year}}年-{{this_month}}月 15 |
      16 | {% endif %} 17 |
    • {{ post.date | date: "%Y年-%m月-%d日" }} » 18 | {{ post.title }} 19 |
    • 20 | 21 | {% if forloop.last %} 22 |
    23 | {% else %} 24 | {% if this_year != next_year %} 25 | 26 | {{next_year}}年-{{next_month}}月 27 |
      28 | {% else %} 29 | {% if this_month != next_month %} 30 |
    31 | {{next_year}}年-{{next_month}}月 32 |
      33 | {% endif %} 34 | {% endif %} 35 | {% endif %} 36 | {% endfor %} -------------------------------------------------------------------------------- /pages/atom.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | 5 | 6 | 7 | {{ site.title }} 8 | {{ site.url }} 9 | {{ site.description }} 10 | {% for post in site.posts limit:20 %} 11 | 12 | {{ post.title }} 13 | {{ site.url }}{{ post.url }} 14 | {{ site.url }}{{ post.url }} 15 | {{ post.date | date_to_rfc822 }} 16 | {{ post.content | xml_escape }} 17 | 18 | {% endfor %} 19 | 20 | -------------------------------------------------------------------------------- /pages/rss.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | 5 | 6 | 7 | {{ site.title }} 8 | {{ site.url }} 9 | {{ site.description }} 10 | {% for post in site.posts limit:20 %} 11 | 12 | {{ post.title }} 13 | {{ site.url }}{{ post.url }} 14 | {{ site.url }}{{ post.url }} 15 | {{ post.date | date_to_rfc822 }} 16 | {{ post.content | xml_escape }} 17 | 18 | {% endfor %} 19 | 20 | -------------------------------------------------------------------------------- /public/codes/oled.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/codes/oled.tar.gz -------------------------------------------------------------------------------- /public/css/base.css: -------------------------------------------------------------------------------- 1 | /* 页面配置 */ 2 | .container {width: 100%; height: 100%;} 3 | body, html { 4 | margin: 0px; 5 | height: 100%; 6 | overflow: hidden; 7 | background-color: #1f2c39; 8 | } 9 | .row {height: 100%;} 10 | /* 导航栏 + 目录栏 */ 11 | .aside {height: 100%;} 12 | /* 左侧导航栏 */ 13 | .aside1 { 14 | background-color: #1f2c39; 15 | height: 100%; 16 | padding-left: 0px; 17 | padding-right: 0px; 18 | text-align: center; 19 | } 20 | .aside1 > .nav > li > a { 21 | padding-left: 0px; 22 | padding-right: 0px; 23 | border-radius: 0px; 24 | } 25 | .avatar {width: 60px; height: 60px;} 26 | .aside1_bottom { 27 | width: 100%; 28 | position: absolute; 29 | bottom: 0px; 30 | left: 0px; 31 | } 32 | .aside1_bottom > .table {margin-bottom: 0px;} 33 | #content ul, ol, dl, li {margin: 0px;} 34 | /* 中部目录栏 */ 35 | .aside2 { 36 | background-color: #fafaf6; 37 | height: 100%; 38 | border-right: 2px solid #18bc9c; 39 | overflow-y: auto; 40 | } 41 | /* 右侧内容栏 */ 42 | .aside3 { 43 | height: 100%; 44 | overflow-y: auto; 45 | background-color: #fafaf6; 46 | } 47 | .aside3-title { 48 | background-color: #1f2c39; 49 | padding-left: 30px; 50 | padding-right: 30px; 51 | text-align: center; 52 | color: #FFF; 53 | } 54 | .aside3-content {padding-left: 30px;padding-right: 30px;} 55 | /* 文章内容排版 */ 56 | a:hover {text-decoration:none;} 57 | #content {font-size: 18px; line-height: 1.5;} 58 | #content p {margin: 20px 0px;} 59 | #content ul, ol, dl, li {margin: 10px 0px;} 60 | .nav > li {margin: 0px;} 61 | #content h2, h3 {line-height: 2;} 62 | #content blockquote > :first-child {margin-top: 0; } 63 | #content blockquote > :last-child {margin-bottom: 0;} 64 | /* 其他配置 */ 65 | .center { text-align: center;} 66 | .nav-pills>li.active>a, .nav-pills>li.active>a:hover, .nav-pills>li.active>a:focus { 67 | color: #2a6496; 68 | background-color: #fafaf6; 69 | } 70 | /* 显示评论按钮 */ 71 | .show-commend {width: 100%; margin-bottom: 40px;} -------------------------------------------------------------------------------- /public/css/highlight.css: -------------------------------------------------------------------------------- 1 | .highlight { background: #ffffff; } 2 | .highlight .c { color: #999988; font-style: italic } /* Comment */ 3 | .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 4 | .highlight .k { font-weight: bold } /* Keyword */ 5 | .highlight .o { font-weight: bold } /* Operator */ 6 | .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 7 | .highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ 8 | .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ 9 | .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 10 | .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 11 | .highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #aa0000 } /* Generic.Error */ 14 | .highlight .gh { color: #999999 } /* Generic.Heading */ 15 | .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 16 | .highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ 17 | .highlight .go { color: #888888 } /* Generic.Output */ 18 | .highlight .gp { color: #555555 } /* Generic.Prompt */ 19 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 20 | .highlight .gu { color: #aaaaaa } /* Generic.Subheading */ 21 | .highlight .gt { color: #aa0000 } /* Generic.Traceback */ 22 | .highlight .kc { font-weight: bold } /* Keyword.Constant */ 23 | .highlight .kd { font-weight: bold } /* Keyword.Declaration */ 24 | .highlight .kp { font-weight: bold } /* Keyword.Pseudo */ 25 | .highlight .kr { font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 27 | .highlight .m { color: #009999 } /* Literal.Number */ 28 | .highlight .s { color: #d14 } /* Literal.String */ 29 | .highlight .na { color: #008080 } /* Name.Attribute */ 30 | .highlight .nb { color: #0086B3 } /* Name.Builtin */ 31 | .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #008080 } /* Name.Constant */ 33 | .highlight .ni { color: #800080 } /* Name.Entity */ 34 | .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ 35 | .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ 36 | .highlight .nn { color: #555555 } /* Name.Namespace */ 37 | .highlight .nt { color: #000080 } /* Name.Tag */ 38 | .highlight .nv { color: #008080 } /* Name.Variable */ 39 | .highlight .ow { font-weight: bold } /* Operator.Word */ 40 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 41 | .highlight .mf { color: #009999 } /* Literal.Number.Float */ 42 | .highlight .mh { color: #009999 } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #009999 } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #009999 } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #d14 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #d14 } /* Literal.String.Char */ 47 | .highlight .sd { color: #d14 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #d14 } /* Literal.String.Double */ 49 | .highlight .se { color: #d14 } /* Literal.String.Escape */ 50 | .highlight .sh { color: #d14 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #d14 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #d14 } /* Literal.String.Other */ 53 | .highlight .sr { color: #009926 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #d14 } /* Literal.String.Single */ 55 | .highlight .ss { color: #990073 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #008080 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #008080 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #008080 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /public/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/img/body_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/img/body_bg.jpg -------------------------------------------------------------------------------- /public/img/oled.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/img/oled.jpg -------------------------------------------------------------------------------- /public/img/spi_oled.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radxa/docs/cbb3849b861142ebf4a3caa4f8aec05d743944c8/public/img/spi_oled.jpg -------------------------------------------------------------------------------- /public/js/base.js: -------------------------------------------------------------------------------- 1 | /* 控制导航按钮动作 */ 2 | function nav_click(is_show) { 3 | if (is_show) { 4 | /* 显示左侧aside */ 5 | $('.aside') 6 | .addClass('visible-md visible-lg') 7 | .removeClass('hidden-md hidden-lg') 8 | /* 调整右侧内容 */ 9 | $('.aside3') 10 | .removeClass('col-md-12 col-lg-12') 11 | .addClass('col-md-8 col-lg-8'); 12 | /* 调整文字内容格式 */ 13 | $('.aside3-content') 14 | .removeClass('col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2') 15 | .addClass('col-md-12'); 16 | } else { 17 | /* 隐藏左侧aside */ 18 | $('.aside') 19 | .removeClass('visible-md visible-lg') 20 | .addClass('hidden-md hidden-lg'); 21 | /* 右侧内容最大化 */ 22 | $('.aside3') 23 | .removeClass('col-md-8 col-lg-8') 24 | .addClass('col-md-12 col-lg-12'); 25 | /* 修改文字排版 */ 26 | $('.aside3-content') 27 | .removeClass('col-md-12') 28 | .addClass('col-md-10 col-lg-8 col-md-offset-1 col-lg-offset-2'); 29 | } 30 | } 31 | /* 控制文章章节列表按钮 */ 32 | function content_click(is_show) { 33 | if (is_show) { 34 | $('#content_table').show(); 35 | } else { 36 | $('#content_table').hide(); 37 | } 38 | } 39 | 40 | function content_effects() { 41 | //remove the asidebar 42 | $('.row-offcanvas').removeClass('active'); 43 | if ($("#nav").length > 0) { 44 | $("#content > h2,#content > h3,#content > h4,#content > h5,#content > h6").each(function(i) { 45 | var current = $(this); 46 | current.attr("id", "title" + i); 47 | tag = current.prop('tagName').substr(-1); 48 | $("#nav").append(""); 49 | }); 50 | $("pre").addClass("prettyprint"); 51 | prettyPrint(); 52 | $('#content img').addClass('img-thumbnail').parent('p').addClass('center'); 53 | $('#content_btn').show(); 54 | } else { 55 | $('#content_btn').hide(); 56 | } 57 | } 58 | 59 | $(document).ready(function() { 60 | /* 控制左侧 aside 的动作 */ 61 | $("#nav_btn").on('click', function() { 62 | isClicked = $(this).data('clicked'); 63 | nav_click(isClicked); 64 | $(this).data('clicked', !isClicked); 65 | }); 66 | 67 | $('body').on('click', '#content_btn' , function() { 68 | isClicked = $(this).data('clicked'); 69 | content_click(!isClicked); 70 | $(this).data('clicked', !isClicked); 71 | }); 72 | 73 | $(document).pjax('.pjaxlink', '#pjax', { 74 | fragment: "#pjax", 75 | timeout: 10000 76 | }); 77 | 78 | $(document).on("pjax:end", function() { 79 | if ($("body").find('.container').width() < 992) 80 | $('#nav_btn').click(); 81 | $('.aside3').scrollTop(0); 82 | content_effects(); 83 | }); 84 | 85 | $('body').on('click', '.show-commend', function() { 86 | var ds_loaded = false; 87 | window.disqus_shortname = $('.show-commend').attr('name'); 88 | $.ajax({ 89 | type: "GET", 90 | url: "http://" + disqus_shortname + ".disqus.com/embed.js", 91 | dataType: "script", 92 | cache: true 93 | }); 94 | }); 95 | content_effects(); 96 | }); -------------------------------------------------------------------------------- /public/js/jquery.pjax.js: -------------------------------------------------------------------------------- 1 | !function(a){function b(b,d,e){var f=this;return this.on("click.pjax",b,function(b){var g=a.extend({},p(d,e));g.container||(g.container=a(this).attr("data-pjax")||f),c(b,g)})}function c(b,c,d){var f,g,h,i;if(d=p(c,d),f=b.currentTarget,"A"!==f.tagName.toUpperCase())throw"$.fn.pjax or $.pjax.click requires an anchor element";b.which>1||b.metaKey||b.ctrlKey||b.shiftKey||b.altKey||location.protocol===f.protocol&&location.hostname===f.hostname&&(f.hash&&f.href.replace(f.hash,"")===location.href.replace(location.hash,"")||f.href!==location.href+"#"&&(b.isDefaultPrevented()||(g={url:f.href,container:a(f).attr("data-pjax"),target:f},h=a.extend({},g,d),i=a.Event("pjax:click"),a(f).trigger(i,[h]),i.isDefaultPrevented()||(e(h),b.preventDefault(),a(f).trigger("pjax:clicked",[h])))))}function d(b,c,d){var f,g;if(d=p(c,d),f=b.currentTarget,"FORM"!==f.tagName.toUpperCase())throw"$.pjax.submit requires a form element";g={type:f.method.toUpperCase(),url:f.action,data:a(f).serializeArray(),container:a(f).attr("data-pjax"),target:f},e(a.extend({},g,d)),b.preventDefault()}function e(b){function h(b,d,e){e||(e={}),e.relatedTarget=c;var g=a.Event(b,e);return f.trigger(g,d),!g.isDefaultPrevented()}var c,d,f,i,j;return b=a.extend(!0,{},a.ajaxSettings,e.defaults,b),a.isFunction(b.url)&&(b.url=b.url()),c=b.target,d=o(b.url).hash,f=b.context=q(b.container),b.data||(b.data={}),b.data._pjax=f.selector,b.beforeSend=function(a,c){return"GET"!==c.type&&(c.timeout=0),a.setRequestHeader("X-PJAX","true"),a.setRequestHeader("X-PJAX-Container",f.selector),h("pjax:beforeSend",[a,c])?(c.timeout>0&&(i=setTimeout(function(){h("pjax:timeout",[a,b])&&a.abort("timeout")},c.timeout),c.timeout=0),b.requestUrl=o(c.url).href,void 0):!1},b.complete=function(a,c){i&&clearTimeout(i),h("pjax:complete",[a,c,b]),h("pjax:end",[a,b])},b.error=function(a,c,d){var e=t("",a,b),f=h("pjax:error",[a,c,d,b]);"GET"==b.type&&"abort"!==c&&f&&g(e.url)},b.success=function(c,i,j){var r,s,v,k=e.state,l="function"==typeof a.pjax.defaults.version?a.pjax.defaults.version():a.pjax.defaults.version,n=j.getResponseHeader("X-PJAX-Version"),p=t(c,j,b);if(l&&n&&l!==n)return g(p.url),void 0;if(!p.contents)return g(p.url),void 0;e.state={id:b.id||m(),url:p.url,title:p.title,container:f.selector,fragment:b.fragment,timeout:b.timeout},(b.push||b.replace)&&window.history.replaceState(e.state,p.title,p.url);try{document.activeElement.blur()}catch(q){}p.title&&(document.title=p.title),h("pjax:beforeReplace",[p.contents,b],{state:e.state,previousState:k}),f.html(p.contents),r=f.find("input[autofocus], textarea[autofocus]").last()[0],r&&document.activeElement!==r&&r.focus(),u(p.scripts),"number"==typeof b.scrollTo&&a(window).scrollTop(b.scrollTo),""!==d&&(s=o(p.url),s.hash=d,e.state.url=s.href,window.history.replaceState(e.state,p.title,s.href),v=a(s.hash),v.length&&a(window).scrollTop(v.offset().top)),h("pjax:success",[c,i,j,b])},e.state||(e.state={id:m(),url:window.location.href,title:document.title,container:f.selector,fragment:b.fragment,timeout:b.timeout},window.history.replaceState(e.state,document.title)),j=e.xhr,j&&j.readyState<4&&(j.onreadystatechange=a.noop,j.abort()),e.options=b,j=e.xhr=a.ajax(b),j.readyState>0&&(b.push&&!b.replace&&(y(e.state.id,f.clone().contents()),window.history.pushState(null,"",n(b.requestUrl))),h("pjax:start",[j,b]),h("pjax:send",[j,b])),e.xhr}function f(b,c){var d={url:window.location.href,push:!1,replace:!0,scrollTo:!1};return e(a.extend(d,p(b,c)))}function g(a){window.history.replaceState(null,"","#"),window.location.replace(a)}function k(b){var f,j,k,l,m,n,c=e.state,d=b.state;if(d&&d.container){if(h&&i==d.url)return;if(e.state&&e.state.id===d.id)return;f=a(d.container),f.length?(k=v[d.id],e.state&&(j=e.state.id",{method:"GET"===d?"GET":"POST",action:c,style:"display:none"});if("GET"!==d&&"POST"!==d&&e.append(a("",{type:"hidden",name:"_method",value:d.toLowerCase()})),f=b.data,"string"==typeof f)a.each(f.split("&"),function(b,c){var d=c.split("=");e.append(a("",{type:"hidden",name:d[0],value:d[1]}))});else if("object"==typeof f)for(key in f)e.append(a("",{type:"hidden",name:key,value:f[key]}));a(document.body).append(e),e.submit()}function m(){return(new Date).getTime()}function n(a){return a.replace(/\?_pjax=[^&]+&?/,"?").replace(/_pjax=[^&]+&?/,"").replace(/[\?&]$/,"")}function o(a){var b=document.createElement("a");return b.href=a,b}function p(b,c){return b&&c?c.container=b:c=a.isPlainObject(b)?b:{container:b},c.container&&(c.container=q(c.container)),c}function q(b){if(b=a(b),b.length){if(""!==b.selector&&b.context===document)return b;if(b.attr("id"))return a("#"+b.attr("id"));throw"cant get selector for pjax container!"}throw"no pjax container for "+b.selector}function r(a,b){return a.filter(b).add(a.find(b))}function s(b){return a.parseHTML(b,document,!0)}function t(b,c,d){var f,g,h,e={};return e.url=n(c.getResponseHeader("X-PJAX-URL")||d.requestUrl),/]*>([\s\S.]*)<\/head>/i)[0])),g=a(s(b.match(/]*>([\s\S.]*)<\/body>/i)[0]))):f=g=a(s(b)),0===g.length?e:(e.title=r(f,"title").last().text(),d.fragment?(h="body"===d.fragment?g:r(g,d.fragment).first(),h.length&&(e.contents=h.contents(),e.title||(e.title=h.attr("title")||h.data("title")))):/e.defaults.maxCacheLength;)delete v[x.shift()]}function z(a,b,c){var d,e;v[b]=c,"forward"===a?(d=x,e=w):(d=w,e=x),d.push(b),(b=e.pop())&&delete v[b]}function A(){return a("meta").filter(function(){var b=a(this).attr("http-equiv");return b&&"X-PJAX-VERSION"===b.toUpperCase()}).attr("content")}function B(){a.fn.pjax=b,a.pjax=e,a.pjax.enable=a.noop,a.pjax.disable=C,a.pjax.click=c,a.pjax.submit=d,a.pjax.reload=f,a.pjax.defaults={timeout:650,push:!0,replace:!1,type:"GET",dataType:"html",scrollTo:0,maxCacheLength:20,version:A},a(window).on("popstate.pjax",k)}function C(){a.fn.pjax=function(){return this},a.pjax=l,a.pjax.enable=B,a.pjax.disable=a.noop,a.pjax.click=a.noop,a.pjax.submit=a.noop,a.pjax.reload=function(){window.location.reload()},a(window).off("popstate.pjax",k)}var v,w,x,h=!0,i=window.location.href,j=window.history.state;j&&j.container&&(e.state=j),"state"in window.history&&(h=!1),v={},w=[],x=[],a.inArray("state",a.event.props)<0&&a.event.props.push("state"),a.support.pjax=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/),a.support.pjax?B():C()}(jQuery); -------------------------------------------------------------------------------- /public/js/prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 2 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-basic.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun", 3 | /^.[^\s\w"$%.]*/,a]]),["basic","cbm"]); 4 | -------------------------------------------------------------------------------- /public/js/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /public/js/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]+)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], 2 | ["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-dart.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 2 | ["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), 3 | ["dart"]); 4 | -------------------------------------------------------------------------------- /public/js/prettify/lang-erlang.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 2 | ["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); 2 | -------------------------------------------------------------------------------- /public/js/prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); 4 | -------------------------------------------------------------------------------- /public/js/prettify/lang-llvm.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); 2 | -------------------------------------------------------------------------------- /public/js/prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 2 | ["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-ml.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 2 | ["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-mumps.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, 2 | null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /public/js/prettify/lang-pascal.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], 3 | ["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); 4 | -------------------------------------------------------------------------------- /public/js/prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /public/js/prettify/lang-r.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], 2 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-rd.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); 2 | -------------------------------------------------------------------------------- /public/js/prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 2 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-sql.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, 2 | null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-tcl.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", 3 | /^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); 4 | -------------------------------------------------------------------------------- /public/js/prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); 2 | -------------------------------------------------------------------------------- /public/js/prettify/lang-vb.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, 2 | null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 2 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], 3 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); 4 | -------------------------------------------------------------------------------- /public/js/prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); 2 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /public/js/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | pre.prettyprint { display: block; background-color: #333 } 2 | pre .nocode { background-color: none; color: #000 } 3 | pre .str { color: #ffa0a0 } /* string - pink */ 4 | pre .kwd { color: #f0e68c; font-weight: bold } 5 | pre .com { color: #87ceeb } /* comment - skyblue */ 6 | pre .typ { color: #98fb98 } /* type - lightgreen */ 7 | pre .lit { color: #cd5c5c } /* literal - darkred */ 8 | pre .pun { color: #fff } /* punctuation */ 9 | pre .pln { color: #fff } /* plaintext */ 10 | pre .tag { color: #f0e68c; font-weight: bold } /* html/xml tag - lightyellow */ 11 | pre .atn { color: #bdb76b; font-weight: bold } /* attribute name - khaki */ 12 | pre .atv { color: #ffa0a0 } /* attribute value - pink */ 13 | pre .dec { color: #98fb98 } /* decimal - lightgreen */ 14 | 15 | /* Specify class=linenums on a pre to get line numbering */ 16 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE } /* IE indents via margin-left */ 17 | /* Alternate shading for lines */ 18 | 19 | @media print { 20 | pre.prettyprint { background-color: none } 21 | pre .str, code .str { color: #060 } 22 | pre .kwd, code .kwd { color: #006; font-weight: bold } 23 | pre .com, code .com { color: #600; font-style: italic } 24 | pre .typ, code .typ { color: #404; font-weight: bold } 25 | pre .lit, code .lit { color: #044 } 26 | pre .pun, code .pun { color: #440 } 27 | pre .pln, code .pln { color: #000 } 28 | pre .tag, code .tag { color: #006; font-weight: bold } 29 | pre .atn, code .atn { color: #404 } 30 | pre .atv, code .atv { color: #060 } 31 | } 32 | -------------------------------------------------------------------------------- /public/js/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | !function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= 3 | b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", 11 | /^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ 12 | s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, 13 | q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= 14 | c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 21 | V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 22 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 23 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), 24 | ["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, 25 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 26 | p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
      "+a+"
      ";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); 27 | return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i=0;){var M=A[m],T=M.src.match(/^[^#?]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D= 4 | [],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]- 8 | a[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y, 13 | g),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\S\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, 14 | r,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,r,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,r,"\"'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/, 15 | r,"#"]),h.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,r])):d.push(["com",/^#[^\n\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\/\/[^\n\r]*/,r]),h.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\n\r")?".":"[\\S\\s]";h.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ 16 | ("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+e+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+e+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),r]);d.push(["pln",/^\s+/,r," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,r],["pln",/^[$_a-z][\w$@]*/i,r],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, 17 | r,"0123456789"],["pln",/^\\[\S\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}} 18 | function e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 22 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 23 | L=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 24 | N=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 25 | S=/\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 26 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\s+/,r," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,r,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 27 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}), 28 | ["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N, 29 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 30 | i(C([],[["str",/^[\S\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
      "+a+"
      ";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML}, 31 | prettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p