Create gh-pages branch via GitHub

gh-pages
Armink 11 years ago
commit 1dd6353a71

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -0,0 +1,636 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>EasyFlash by armink</title>
</head>
<body>
<header>
<div class="inner">
<h1>EasyFlash</h1>
<h2>EasyFlash is an open source lightweight embedded flash memory library. </h2>
<a href="https://github.com/armink/EasyFlash" class="button"><small>View project on</small> GitHub</a>
</div>
</header>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<h1>
<a id="easyflash-使用说明" class="anchor" href="#easyflash-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E" aria-hidden="true"><span class="octicon octicon-link"></span></a>EasyFlash 使用说明</h1>
<hr>
<h2>
<a id="1介绍" class="anchor" href="#1%E4%BB%8B%E7%BB%8D" aria-hidden="true"><span class="octicon octicon-link"></span></a>1、介绍</h2>
<p>EasyFlash是一款开源的轻量级嵌入式Flash存储器库主要为MCU(Micro Control Unit)提供便捷、通用的上层应用接口使得开发者更加高效实现基于的Flash存储器常见应用开发。该库目前提供 <strong>两大实用功能</strong> </p>
<ul>
<li>
<p><strong>Env</strong> 让变量轻轻松松实现掉电保存,无需担心变量长度、对其等问题</p>
<p>使用 <strong>键值对(key-value)</strong> 方式将变量存储到Flash中类似U-Boot的 <code>环境变量</code> 使用方式与U-Boot一致。</p>
</li>
<li>
<p><strong>IAP</strong> 在线升级再也不是难事儿</p>
<p>该库封装了IAP(In-Application Programming)功能常用的接口支持CRC32校验同时支持Bootloader及Application的升级。</p>
</li>
</ul>
<h3>
<a id="11文件结构" class="anchor" href="#11%E6%96%87%E4%BB%B6%E7%BB%93%E6%9E%84" aria-hidden="true"><span class="octicon octicon-link"></span></a>1.1、文件结构</h3>
<table>
<thead>
<tr>
<th align="left">源文件</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">\flash\src\flash_env.c</td>
<td align="left">Env环境变量相关操作接口及实现源码</td>
</tr>
<tr>
<td align="left">\flash\src\flash_iap.c</td>
<td align="left">IAP在线升级相关操作接口及实现源码</td>
</tr>
<tr>
<td align="left">\flash\src\flash_utils.c</td>
<td align="left">EasyFlash常用小工具例如CRC32</td>
</tr>
<tr>
<td align="left">\flash\src\flash.c</td>
<td align="left">目前只包含EasyFlash初始化方法</td>
</tr>
<tr>
<td align="left">\flash\port\flash_port.c</td>
<td align="left">不同平台下的EasyFlash移植接口及配置参数</td>
</tr>
<tr>
<td align="left">\demo\stm32f10x</td>
<td align="left">stm32f10x平台下的demo</td>
</tr>
</tbody>
</table>
<h3>
<a id="12资源占用" class="anchor" href="#12%E8%B5%84%E6%BA%90%E5%8D%A0%E7%94%A8" aria-hidden="true"><span class="octicon octicon-link"></span></a>1.2、资源占用</h3>
<pre><code>最低要求: ROM: 6K bytes RAM: 0.5K bytes + (Env大小)
Demo平台STM32F103RET6 + RT-Thread 1.2.2 + Env(2K bytes)
实际占用: ROM: 6K bytes RAM: 2.6K bytes
</code></pre>
<h3>
<a id="13支持平台" class="anchor" href="#13%E6%94%AF%E6%8C%81%E5%B9%B3%E5%8F%B0" aria-hidden="true"><span class="octicon octicon-link"></span></a>1.3、支持平台</h3>
<p>目前已移植平台只有 <code>STM32F10X</code> 系列的片内Flash这个也是笔者产品使用的平台。其余平台的移植难度不大在项目的设计之初就有考虑针对所有平台的适配性问题64位除外所以对所有移植接口都有做预留。移植只需修改 <code>\flash\port\flash_port.c</code> 一个文件,实现里面的擦、写、读及打印功能即可。</p>
<p>欢迎大家 <strong>fork and pull request</strong> 。开源软件的成功离不开所有人的努力,也希望该项目能够帮助大家降低开发周期,让产品更早的获得成功。</p>
<h2>
<a id="2流程" class="anchor" href="#2%E6%B5%81%E7%A8%8B" aria-hidden="true"><span class="octicon octicon-link"></span></a>2、流程</h2>
<h3>
<a id="21环境变量" class="anchor" href="#21%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>2.1、环境变量</h3>
<p>下图为人工通过控制台来调用环境变量的常用接口,演示了环境变量 <code>"temp"</code> 从创建到保存,再修改,最后删除的过程。这些接口都支持被应用层直接调用。</p>
<p><img src="https://cloud.githubusercontent.com/assets/1734686/5886463/46ad7efa-a3db-11e4-8401-75c00a4c35ba.gif" alt="easy_flash_env"></p>
<h3>
<a id="22在线升级" class="anchor" href="#22%E5%9C%A8%E7%BA%BF%E5%8D%87%E7%BA%A7" aria-hidden="true"><span class="octicon octicon-link"></span></a>2.2、在线升级</h3>
<p>下图演示了通过控制台来进行IAP升级软件的过程使用的是库中自带的IAP功能接口演示采用的是串口+Ymodem协议的方式。你还也可以实现通过CAN、485、以太网等总线来实现远程网络更新。</p>
<p><img src="https://cloud.githubusercontent.com/assets/1734686/5886462/40f7d62c-a3db-11e4-866a-ba827c809370.gif" alt="easy_flash_iap"></p>
<h2>
<a id="3api" class="anchor" href="#3api" aria-hidden="true"><span class="octicon octicon-link"></span></a>3、API</h2>
<p>所有支持的API接口都在 <code>\flash\inc\flash.h</code> 中声明。以下内容较多,建议使用 <strong>CTRL+F</strong> 搜索。</p>
<p>名词介绍:</p>
<p><strong>备份区</strong> 是EasyFlash定义的一个存放环境变量及已下载程序的Flash区域详细存储架构可以参考 <code>\flash\src\flash.c</code> 文件头位置的注释说明。</p>
<p><strong>环境变量表</strong> 负责存放所有的环境变量该表在Flash及RAM中均存在上电后需从Flash加载到RAM中修改后则需要保存其至Flash中。</p>
<h3>
<a id="31-初始化" class="anchor" href="#31-%E5%88%9D%E5%A7%8B%E5%8C%96" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.1 初始化</h3>
<p>初始化EasyFlash。在初始化的过程中会使用 <code>\flash\port\flash_port.c</code> 中的用户自定义参数。</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_init</span>(<span class="pl-st">void</span>)</pre></div>
<h3>
<a id="32-环境变量" class="anchor" href="#32-%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2 环境变量</h3>
<h4>
<a id="321-加载环境变量" class="anchor" href="#321-%E5%8A%A0%E8%BD%BD%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.1 加载环境变量</h4>
<p>加载Flash中的所有环境变量到系统内存中。</p>
<div class="highlight highlight-C"><pre><span class="pl-st">void</span> <span class="pl-en">flash_load_env</span>(<span class="pl-st">void</span>)</pre></div>
<h4>
<a id="322-打印环境变量" class="anchor" href="#322-%E6%89%93%E5%8D%B0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.2 打印环境变量</h4>
<p>通过在移植接口( <code>\flash\port\flash_port.c</code> )中定义的 <code>flash_print</code> 打印方法来将Flash中的所有环境变量输出出来。</p>
<div class="highlight highlight-C"><pre><span class="pl-st">void</span> <span class="pl-en">flash_print_env</span>(<span class="pl-st">void</span>)</pre></div>
<h4>
<a id="323-获取环境变量" class="anchor" href="#323-%E8%8E%B7%E5%8F%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.3 获取环境变量</h4>
<p>通过环境变量的名字来获取其对应的值。(注意:此处的环境变量指代的已加载到内存中的环境变量)</p>
<div class="highlight highlight-C"><pre><span class="pl-st">char</span> *<span class="pl-en">flash_get_env</span>(<span class="pl-s">const</span> <span class="pl-st">char</span> *key)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">key</td>
<td align="left">环境变量名称</td>
</tr>
</tbody>
</table>
<h4>
<a id="324-设置环境变量" class="anchor" href="#324-%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.4 设置环境变量</h4>
<p>使用此方法可以实现对环境变量的增加、修改及删除功能。(注意:此处的环境变量指代的已加载到内存中的环境变量)</p>
<p><strong>增加</strong> :当环境变量表中不存在该名称的环境变量时,则会执行新增操作;</p>
<p><strong>修改</strong> :入参中的环境变量名称在当前环境变量表中存在,则把该环境变量值修改为入参中的值;</p>
<p><strong>删除</strong> 当入参中的value为空时则会删除入参名对应的环境变量。</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_set_env</span>(<span class="pl-s">const</span> <span class="pl-st">char</span> *key, <span class="pl-s">const</span> <span class="pl-st">char</span> *value)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">key</td>
<td align="left">环境变量名称</td>
</tr>
<tr>
<td align="left">value</td>
<td align="left">环境变量值</td>
</tr>
</tbody>
</table>
<h4>
<a id="325-保存环境变量" class="anchor" href="#325-%E4%BF%9D%E5%AD%98%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.5 保存环境变量</h4>
<p>保存内存中的环境变量表到Flash中。</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_save_env</span>(<span class="pl-st">void</span>)</pre></div>
<h4>
<a id="326-恢复环境变量" class="anchor" href="#326-%E6%81%A2%E5%A4%8D%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.6 恢复环境变量</h4>
<p>将内存中的环境变量表恢复为默认值。</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_env_set_default</span>(<span class="pl-st">void</span>)</pre></div>
<h4>
<a id="327-获取环境变量分区的总容量" class="anchor" href="#327-%E8%8E%B7%E5%8F%96%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E5%88%86%E5%8C%BA%E7%9A%84%E6%80%BB%E5%AE%B9%E9%87%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.7 获取环境变量分区的总容量</h4>
<div class="highlight highlight-C"><pre><span class="pl-s3">uint32_t</span> <span class="pl-en">flash_get_env_total_size</span>(<span class="pl-st">void</span>)</pre></div>
<h4>
<a id="328-获取当前已使用环境变量的大小" class="anchor" href="#328-%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E5%B7%B2%E4%BD%BF%E7%94%A8%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E7%9A%84%E5%A4%A7%E5%B0%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.2.8 获取当前已使用环境变量的大小</h4>
<div class="highlight highlight-C"><pre><span class="pl-s3">uint32_t</span> <span class="pl-en">flash_get_env_used_size</span>(<span class="pl-st">void</span>)</pre></div>
<h3>
<a id="33-在线升级" class="anchor" href="#33-%E5%9C%A8%E7%BA%BF%E5%8D%87%E7%BA%A7" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.3 在线升级</h3>
<h4>
<a id="331-擦除备份区中的应用程序" class="anchor" href="#331-%E6%93%A6%E9%99%A4%E5%A4%87%E4%BB%BD%E5%8C%BA%E4%B8%AD%E7%9A%84%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.3.1 擦除备份区中的应用程序</h4>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_erase_bak_app</span>(<span class="pl-s3">size_t</span> app_size)</pre></div>
<h4>
<a id="332-擦除用户的应用程序" class="anchor" href="#332-%E6%93%A6%E9%99%A4%E7%94%A8%E6%88%B7%E7%9A%84%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.3.2 擦除用户的应用程序</h4>
<p>注意:请不要在应用程序中调用该方法</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_erase_user_app</span>(<span class="pl-s3">uint32_t</span> user_app_addr, <span class="pl-s3">size_t</span> user_app_size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">user_app_addr</td>
<td align="left">用户应用程序入口地址</td>
</tr>
<tr>
<td align="left">user_app_size</td>
<td align="left">用户应用程序大小</td>
</tr>
</tbody>
</table>
<h4>
<a id="333-擦除bootloader" class="anchor" href="#333-%E6%93%A6%E9%99%A4bootloader" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.3.3 擦除Bootloader</h4>
<p>注意请不要在Bootloader中调用该方法</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_erase_bl</span>(<span class="pl-s3">uint32_t</span> bl_addr, <span class="pl-s3">size_t</span> bl_size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">bl_addr</td>
<td align="left">Bootloader入口地址</td>
</tr>
<tr>
<td align="left">bl_size</td>
<td align="left">Bootloader大小</td>
</tr>
</tbody>
</table>
<h4>
<a id="334-写数据到备份区" class="anchor" href="#334-%E5%86%99%E6%95%B0%E6%8D%AE%E5%88%B0%E5%A4%87%E4%BB%BD%E5%8C%BA" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.3.4 写数据到备份区</h4>
<p>为下载程序到备份区定制的Flash连续写方法。
注意写之前请先确认Flash已进行擦除。</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_write_data_to_bak</span>(<span class="pl-s3">uint8_t</span> *data,
<span class="pl-s3">size_t</span> size,
<span class="pl-s3">size_t</span> *cur_size,
<span class="pl-s3">size_t</span> total_size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">data</td>
<td align="left">需要写入到备份区中的数据存储地址</td>
</tr>
<tr>
<td align="left">size</td>
<td align="left">此次写入数据的大小(字节)</td>
</tr>
<tr>
<td align="left">cur_size</td>
<td align="left">之前已写入到备份区中的数据大小(字节)</td>
</tr>
<tr>
<td align="left">total_size</td>
<td align="left">需要写入到备份区的数据总大小(字节)</td>
</tr>
</tbody>
</table>
<h4>
<a id="335-从备份拷贝应用程序" class="anchor" href="#335-%E4%BB%8E%E5%A4%87%E4%BB%BD%E6%8B%B7%E8%B4%9D%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.3.5 从备份拷贝应用程序</h4>
<p>将备份区已下载好的应用程序拷贝至用户应用程序起始地址。
注意:
1、拷贝前必须对原有的应用程序进行擦除
2、不要在应用程序中调用该方法</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_copy_app_from_bak</span>(<span class="pl-s3">uint32_t</span> user_app_addr, <span class="pl-s3">size_t</span> app_size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">user_app_addr</td>
<td align="left">用户应用程序入口地址</td>
</tr>
<tr>
<td align="left">user_app_size</td>
<td align="left">用户应用程序大小</td>
</tr>
</tbody>
</table>
<h4>
<a id="335-从备份拷贝bootloader" class="anchor" href="#335-%E4%BB%8E%E5%A4%87%E4%BB%BD%E6%8B%B7%E8%B4%9Dbootloader" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.3.5 从备份拷贝Bootloader</h4>
<p>将备份区已下载好的Bootloader拷贝至Bootloader起始地址。
注意:
1、拷贝前必须对原有的Bootloader进行擦除
2、不要在Bootloader中调用该方法</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_copy_bl_from_bak</span>(<span class="pl-s3">uint32_t</span> bl_addr, <span class="pl-s3">size_t</span> bl_size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">bl_addr</td>
<td align="left">Bootloader入口地址</td>
</tr>
<tr>
<td align="left">bl_size</td>
<td align="left">Bootloader大小</td>
</tr>
</tbody>
</table>
<h3>
<a id="34-移植" class="anchor" href="#34-%E7%A7%BB%E6%A4%8D" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4 移植</h3>
<h4>
<a id="341-读取flash" class="anchor" href="#341-%E8%AF%BB%E5%8F%96flash" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.1 读取Flash</h4>
<p>最小单位为4个字节</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_read</span>(<span class="pl-s3">uint32_t</span> addr, <span class="pl-s3">uint32_t</span> *buf, <span class="pl-s3">size_t</span> size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">addr</td>
<td align="left">读取起始地址</td>
</tr>
<tr>
<td align="left">buf</td>
<td align="left">存放读取数据的缓冲区</td>
</tr>
<tr>
<td align="left">size</td>
<td align="left">读取数据的大小(字节)</td>
</tr>
</tbody>
</table>
<h4>
<a id="342-擦除flash" class="anchor" href="#342-%E6%93%A6%E9%99%A4flash" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.2 擦除Flash</h4>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_erase</span>(<span class="pl-s3">uint32_t</span> addr, <span class="pl-s3">size_t</span> size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">addr</td>
<td align="left">擦除起始地址</td>
</tr>
<tr>
<td align="left">size</td>
<td align="left">擦除数据的大小(字节)</td>
</tr>
</tbody>
</table>
<h4>
<a id="343-写入flash" class="anchor" href="#343-%E5%86%99%E5%85%A5flash" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.3 写入Flash</h4>
<p>最小单位为4个字节</p>
<div class="highlight highlight-C"><pre>FlashErrCode <span class="pl-en">flash_write</span>(<span class="pl-s3">uint32_t</span> addr, <span class="pl-s">const</span> <span class="pl-s3">uint32_t</span> *buf, <span class="pl-s3">size_t</span> size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">addr</td>
<td align="left">写入的起始地址</td>
</tr>
<tr>
<td align="left">buf</td>
<td align="left">源数据的缓冲区</td>
</tr>
<tr>
<td align="left">size</td>
<td align="left">写入数据的大小(字节)</td>
</tr>
</tbody>
</table>
<h4>
<a id="344-分配动态内存" class="anchor" href="#344-%E5%88%86%E9%85%8D%E5%8A%A8%E6%80%81%E5%86%85%E5%AD%98" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.4 分配动态内存</h4>
<div class="highlight highlight-C"><pre><span class="pl-st">void</span> *<span class="pl-en">flash_malloc</span>(<span class="pl-s3">size_t</span> size)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">size</td>
<td align="left">需分配的内存大小</td>
</tr>
</tbody>
</table>
<h4>
<a id="345-释放动态内存" class="anchor" href="#345-%E9%87%8A%E6%94%BE%E5%8A%A8%E6%80%81%E5%86%85%E5%AD%98" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.5 释放动态内存</h4>
<div class="highlight highlight-C"><pre><span class="pl-st">void</span> <span class="pl-en">flash_free</span>(<span class="pl-st">void</span> *p)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">p</td>
<td align="left">需释放的动态内存地址</td>
</tr>
</tbody>
</table>
<h4>
<a id="346-打印调试日志信息" class="anchor" href="#346-%E6%89%93%E5%8D%B0%E8%B0%83%E8%AF%95%E6%97%A5%E5%BF%97%E4%BF%A1%E6%81%AF" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.6 打印调试日志信息</h4>
<p>在定义 <code>FLASH_PRINT_DEBUG</code> 宏后,打印调试日志信息</p>
<div class="highlight highlight-C"><pre><span class="pl-st">void</span> <span class="pl-en">flash_log_debug</span>(<span class="pl-s">const</span> <span class="pl-st">char</span> *file, <span class="pl-s">const</span> <span class="pl-st">long</span> line, <span class="pl-s">const</span> <span class="pl-st">char</span> *format, ...)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">file</td>
<td align="left">调用该方法的文件</td>
</tr>
<tr>
<td align="left">line</td>
<td align="left">调用该方法的行号</td>
</tr>
<tr>
<td align="left">format</td>
<td align="left">打印格式</td>
</tr>
<tr>
<td align="left">...</td>
<td align="left">不定参</td>
</tr>
</tbody>
</table>
<h4>
<a id="347-打印普通日志信息" class="anchor" href="#347-%E6%89%93%E5%8D%B0%E6%99%AE%E9%80%9A%E6%97%A5%E5%BF%97%E4%BF%A1%E6%81%AF" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.7 打印普通日志信息</h4>
<div class="highlight highlight-C"><pre><span class="pl-st">void</span> <span class="pl-en">flash_log_info</span>(<span class="pl-s">const</span> <span class="pl-st">char</span> *format, ...)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">format</td>
<td align="left">打印格式</td>
</tr>
<tr>
<td align="left">...</td>
<td align="left">不定参</td>
</tr>
</tbody>
</table>
<h4>
<a id="348-无格式打印信息" class="anchor" href="#348-%E6%97%A0%E6%A0%BC%E5%BC%8F%E6%89%93%E5%8D%B0%E4%BF%A1%E6%81%AF" aria-hidden="true"><span class="octicon octicon-link"></span></a>3.4.8 无格式打印信息</h4>
<p>该方法输出无固定格式的打印信息,为 <code>flash_print_env</code> 方法所用。而 <code>flash_log_debug</code><code>flash_log_info</code> 可以输出带指定前缀及格式的打印日志信息。</p>
<div class="highlight highlight-C"><pre><span class="pl-st">void</span> <span class="pl-en">flash_print</span>(<span class="pl-s">const</span> <span class="pl-st">char</span> *format, ...)</pre></div>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">format</td>
<td align="left">打印格式</td>
</tr>
<tr>
<td align="left">...</td>
<td align="left">不定参</td>
</tr>
</tbody>
</table>
<h2>
<a id="4注意" class="anchor" href="#4%E6%B3%A8%E6%84%8F" aria-hidden="true"><span class="octicon octicon-link"></span></a>4、注意</h2>
<p>1、写数据前务必记得先擦除</p>
<p>2、环境变量设置完后只有调用 <code>flash_save_env</code> 才会保存在Flash中否则开机会丢失修改的内容</p>
<p>3、不要在应用程序及Bootloader中执行擦除及拷贝自身的动作</p>
<p>4、Flash读取和写入方法的最小单位为4个字节擦除的最小单位则需根据用户的平台来确定</p>
</section>
<aside id="sidebar">
<a href="https://github.com/armink/EasyFlash/zipball/master" class="button">
<small>Download</small>
.zip file
</a>
<a href="https://github.com/armink/EasyFlash/tarball/master" class="button">
<small>Download</small>
.tar.gz file
</a>
<p class="repo-owner"><a href="https://github.com/armink/EasyFlash"></a> is maintained by <a href="https://github.com/armink">armink</a>.</p>
<p>This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the Architect theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.</p>
</aside>
</div>
</div>
</body>
</html>

@ -0,0 +1 @@
console.log('This would be the main JS file.');

File diff suppressed because one or more lines are too long

@ -0,0 +1,228 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
padding: 0;
margin: 0;
font: inherit;
font-size: 100%;
vertical-align: baseline;
border: 0;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
body {
font-family: 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 13px;
line-height: 1.5;
color: #000;
}
a {
font-weight: bold;
color: #d5000d;
}
header {
padding-top: 35px;
padding-bottom: 10px;
}
header h1 {
font-size: 48px;
font-weight: bold;
line-height: 1.2;
color: #303030;
letter-spacing: -1px;
}
header h2 {
font-size: 24px;
font-weight: normal;
line-height: 1.3;
color: #aaa;
letter-spacing: -1px;
}
#downloads {
display: none;
}
#main_content {
padding-top: 20px;
}
code, pre {
margin-bottom: 30px;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal;
font-size: 12px;
color: #222;
}
code {
padding: 0 3px;
}
pre {
padding: 20px;
overflow: auto;
border: solid 1px #ddd;
}
pre code {
padding: 0;
}
ul, ol, dl {
margin-bottom: 20px;
}
/* COMMON STYLES */
table {
width: 100%;
border: 1px solid #ebebeb;
}
th {
font-weight: 500;
}
td {
font-weight: 300;
text-align: center;
border: 1px solid #ebebeb;
}
form {
padding: 20px;
background: #f2f2f2;
}
/* GENERAL ELEMENT TYPE STYLES */
h1 {
font-size: 2.8em;
}
h2 {
margin-bottom: 8px;
font-size: 22px;
font-weight: bold;
color: #303030;
}
h3 {
margin-bottom: 8px;
font-size: 18px;
font-weight: bold;
color: #d5000d;
}
h4 {
font-size: 16px;
font-weight: bold;
color: #303030;
}
h5 {
font-size: 1em;
color: #303030;
}
h6 {
font-size: .8em;
color: #303030;
}
p {
margin-bottom: 20px;
font-weight: 300;
}
a {
text-decoration: none;
}
p a {
font-weight: 400;
}
blockquote {
padding: 0 0 0 30px;
margin-bottom: 20px;
font-size: 1.6em;
border-left: 10px solid #e9e9e9;
}
ul li {
padding-left: 20px;
list-style-position: inside;
list-style: disc;
}
ol li {
padding-left: 3px;
list-style-position: inside;
list-style: decimal;
}
dl dd {
font-style: italic;
font-weight: 100;
}
footer {
padding-top: 20px;
padding-bottom: 30px;
margin-top: 40px;
font-size: 13px;
color: #aaa;
}
footer a {
color: #666;
}
/* MISC */
.clearfix:after {
display: block;
height: 0;
clear: both;
visibility: hidden;
content: '.';
}
.clearfix {display: inline-block;}
* html .clearfix {height: 1%;}
.clearfix {display: block;}

@ -0,0 +1,69 @@
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }

@ -0,0 +1,881 @@
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
margin: 0.67em 0;
font-size: 2em;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
color: #000;
background: #ff0;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
height: 0;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
margin: 0; /* 3 */
font: inherit; /* 2 */
color: inherit; /* 1 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-box-sizing: content-box; /* 2 */
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield; /* 1 */
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
padding: 0.35em 0.625em 0.75em;
margin: 0 2px;
border: 1px solid #c0c0c0;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
padding: 0; /* 2 */
border: 0; /* 1 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
/* LAYOUT STYLES */
body {
font-family: 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 15px;
font-weight: 400;
line-height: 1.5;
color: #666;
background: #fafafa url(../images/body-bg.jpg) 0 0 repeat;
}
p {
margin-top: 0;
}
a {
color: #2879d0;
}
a:hover {
color: #2268b2;
}
header {
padding-top: 40px;
padding-bottom: 40px;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
background: #2e7bcf url(../images/header-bg.jpg) 0 0 repeat-x;
border-bottom: solid 1px #275da1;
}
header h1 {
width: 540px;
margin-top: 0;
margin-bottom: 0.2em;
font-size: 72px;
font-weight: normal;
line-height: 1;
color: #fff;
letter-spacing: -1px;
}
header h2 {
width: 540px;
margin-top: 0;
margin-bottom: 0;
font-size: 26px;
font-weight: normal;
line-height: 1.3;
color: #9ddcff;
letter-spacing: 0;
}
.inner {
position: relative;
width: 940px;
margin: 0 auto;
}
#content-wrapper {
padding-top: 30px;
border-top: solid 1px #fff;
}
#main-content {
float: left;
width: 690px;
}
#main-content img {
max-width: 100%;
}
aside#sidebar {
float: right;
width: 200px;
min-height: 504px;
padding-left: 20px;
font-size: 12px;
line-height: 1.3;
background: transparent url(../images/sidebar-bg.jpg) 0 0 no-repeat;
}
aside#sidebar p.repo-owner,
aside#sidebar p.repo-owner a {
font-weight: bold;
}
#downloads {
margin-bottom: 40px;
}
a.button {
width: 134px;
height: 58px;
padding-top: 22px;
padding-left: 68px;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 23px;
line-height: 1.2;
color: #fff;
}
a.button small {
display: block;
font-size: 11px;
}
header a.button {
position: absolute;
top: 0;
right: 0;
background: transparent url(../images/github-button.png) 0 0 no-repeat;
}
aside a.button {
display: block;
width: 138px;
padding-left: 64px;
margin-bottom: 20px;
font-size: 21px;
background: transparent url(../images/download-button.png) 0 0 no-repeat;
}
code, pre {
margin-bottom: 30px;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
font-size: 13px;
color: #222;
}
code {
padding: 0 3px;
background-color: #f2f8fc;
border: solid 1px #dbe7f3;
}
pre {
padding: 20px;
overflow: auto;
text-shadow: none;
background: #fff;
border: solid 1px #f2f2f2;
}
pre code {
padding: 0;
color: #2879d0;
background-color: #fff;
border: none;
}
ul, ol, dl {
margin-bottom: 20px;
}
/* COMMON STYLES */
hr {
height: 0;
margin-top: 1em;
margin-bottom: 1em;
border: 0;
border-top: solid 1px #ddd;
}
table {
width: 100%;
border: 1px solid #ebebeb;
}
th {
font-weight: 500;
}
td {
font-weight: 300;
text-align: center;
border: 1px solid #ebebeb;
}
form {
padding: 20px;
background: #f2f2f2;
}
/* GENERAL ELEMENT TYPE STYLES */
#main-content h1 {
margin-top: 0;
margin-bottom: 0;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 2.8em;
font-weight: normal;
color: #474747;
text-indent: 6px;
letter-spacing: -1px;
}
#main-content h1:before {
padding-right: 0.3em;
margin-left: -0.9em;
color: #9ddcff;
content: "/";
}
#main-content h2 {
margin-bottom: 8px;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 22px;
font-weight: bold;
color: #474747;
text-indent: 4px;
}
#main-content h2:before {
padding-right: 0.3em;
margin-left: -1.5em;
content: "//";
color: #9ddcff;
}
#main-content h3 {
margin-top: 24px;
margin-bottom: 8px;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 18px;
font-weight: bold;
color: #474747;
text-indent: 3px;
}
#main-content h3:before {
padding-right: 0.3em;
margin-left: -2em;
content: "///";
color: #9ddcff;
}
#main-content h4 {
margin-bottom: 8px;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 15px;
font-weight: bold;
color: #474747;
text-indent: 3px;
}
h4:before {
padding-right: 0.3em;
margin-left: -2.8em;
content: "////";
color: #9ddcff;
}
#main-content h5 {
margin-bottom: 8px;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
font-size: 14px;
color: #474747;
text-indent: 3px;
}
h5:before {
padding-right: 0.3em;
margin-left: -3.2em;
content: "/////";
color: #9ddcff;
}
#main-content h6 {
margin-bottom: 8px;
font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif;
font-size: .8em;
color: #474747;
text-indent: 3px;
}
h6:before {
padding-right: 0.3em;
margin-left: -3.7em;
content: "//////";
color: #9ddcff;
}
p {
margin-bottom: 20px;
}
a {
text-decoration: none;
}
p a {
font-weight: 400;
}
blockquote {
padding: 0 0 0 30px;
margin-bottom: 20px;
font-size: 1.6em;
border-left: 10px solid #e9e9e9;
}
ul {
list-style-position: inside;
list-style: disc;
padding-left: 20px;
}
ol {
list-style-position: inside;
list-style: decimal;
padding-left: 3px;
}
dl dd {
font-style: italic;
font-weight: 100;
}
footer {
padding-top: 20px;
padding-bottom: 30px;
margin-top: 40px;
font-size: 13px;
color: #aaa;
background: transparent url('../images/hr.png') 0 0 no-repeat;
}
footer a {
color: #666;
}
footer a:hover {
color: #444;
}
/* MISC */
.clearfix:after {
display: block;
height: 0;
clear: both;
visibility: hidden;
content: '.';
}
.clearfix {display: inline-block;}
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* #Media Queries
================================================== */
/* Smaller than standard 960 (devices and browsers) */
@media only screen and (max-width: 959px) { }
/* Tablet Portrait size to standard 960 (devices and browsers) */
@media only screen and (min-width: 768px) and (max-width: 959px) {
.inner {
width: 740px;
}
header h1, header h2 {
width: 340px;
}
header h1 {
font-size: 60px;
}
header h2 {
font-size: 30px;
}
#main-content {
width: 490px;
}
#main-content h1:before,
#main-content h2:before,
#main-content h3:before,
#main-content h4:before,
#main-content h5:before,
#main-content h6:before {
padding-right: 0;
margin-left: 0;
content: none;
}
}
/* All Mobile Sizes (devices and browser) */
@media only screen and (max-width: 767px) {
.inner {
width: 93%;
}
header {
padding: 20px 0;
}
header .inner {
position: relative;
}
header h1, header h2 {
width: 100%;
}
header h1 {
font-size: 48px;
}
header h2 {
font-size: 24px;
}
header a.button {
position: relative;
display: inline-block;
width: auto;
height: auto;
padding: 5px 10px;
margin-top: 15px;
font-size: 13px;
line-height: 1;
color: #2879d0;
text-align: center;
background-color: #9ddcff;
background-image: none;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
header a.button small {
display: inline;
font-size: 13px;
}
#main-content,
aside#sidebar {
float: none;
width: 100% ! important;
}
aside#sidebar {
min-height: 0;
padding: 20px 0;
margin-top: 20px;
background-image: none;
border-top: solid 1px #ddd;
}
aside#sidebar a.button {
display: none;
}
#main-content h1:before,
#main-content h2:before,
#main-content h3:before,
#main-content h4:before,
#main-content h5:before,
#main-content h6:before {
padding-right: 0;
margin-left: 0;
content: none;
}
}
/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
@media only screen and (min-width: 480px) and (max-width: 767px) { }
/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
@media only screen and (max-width: 479px) { }
Loading…
Cancel
Save