Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cbb03c9d9c | |||
| 5e921a1546 | |||
| f71c3f4124 | |||
| ee68f37f04 | |||
| 99d4844c01 | |||
| 6d114add28 |
@@ -0,0 +1,779 @@
|
|||||||
|
# 12~24V 2P2N双色LED H桥驱动原理与器件设计
|
||||||
|
|
||||||
|
## 1. 文档目的
|
||||||
|
|
||||||
|
本文针对一套输入电压为12~24V的双色LED H桥驱动电路。主功率桥由2只PMOS和2只NMOS组成,另外使用2只小信号NMOS驱动高边PMOS,因此整个驱动部分共使用6只MOS管。
|
||||||
|
|
||||||
|
本文说明:
|
||||||
|
|
||||||
|
- 2P2N主桥和2只驱动MOS分别承担什么工作;
|
||||||
|
- 双色LED为什么需要H桥改变电流方向;
|
||||||
|
- 两路PWM输入怎样控制暖光、冷光和关闭状态;
|
||||||
|
- 为什么两路输入绝对不能同时为高电平;
|
||||||
|
- 为什么换向必须先输出`00`并保留死区;
|
||||||
|
- PMOS为什么需要栅极上拉电阻和下拉电阻;
|
||||||
|
- 两个电阻为什么会形成分压;
|
||||||
|
- 电阻太大或太小分别会产生什么问题;
|
||||||
|
- 12V稳压管在电路中起什么作用;
|
||||||
|
- 如何计算PMOS的栅源电压、电阻功耗和稳压管电流;
|
||||||
|
- 如果取消稳压管,应当如何重新选择电阻;
|
||||||
|
- 为什么还必须检查死区时间、MOS管尖峰和PCB布局。
|
||||||
|
|
||||||
|
本文尽量使用直观的方式说明,适合刚接触MOS管驱动电路的工程人员阅读。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 完整电路由哪些部分组成
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
图1:本项目12~24V、2P2N主桥加2只小MOS驱动的完整原理图。
|
||||||
|
|
||||||
|
图中的主要器件分工如下:
|
||||||
|
|
||||||
|
| 器件 | 类型 | 作用 |
|
||||||
|
|---|---|---|
|
||||||
|
| Q1、Q2 | 高边PMOS(60P03) | 分别把C端、W端连接到12~24V电源 |
|
||||||
|
| Q9、Q10 | 低边NMOS(60N03) | 分别把C端、W端连接到GND |
|
||||||
|
| Q7、Q8 | 小信号NMOS(AO3400A) | 分别下拉Q1、Q2的栅极 |
|
||||||
|
| R1、R2 | 2.4kΩ上拉电阻 | 使Q1、Q2快速关断 |
|
||||||
|
| R3、R4 | 3kΩ下拉通路电阻 | 与R1、R2分压,限制高边PMOS的导通VGS |
|
||||||
|
| D1、D2 | 12V稳压管(BZT52C12) | 限制高边PMOS的栅源电压尖峰 |
|
||||||
|
| R14、R15 | 10kΩ栅源下拉电阻 | 确保Q9、Q10在控制信号悬空时保持关闭 |
|
||||||
|
|
||||||
|
### 2.1 2只高边PMOS
|
||||||
|
|
||||||
|
高边使用2只PMOS:
|
||||||
|
|
||||||
|
- 左侧PMOS负责把输出端`C`连接到12~24V电源;
|
||||||
|
- 右侧PMOS负责把输出端`W`连接到12~24V电源。
|
||||||
|
|
||||||
|
PMOS适合放在高边,是因为它的源极可以直接接正电源,栅极只需要从源极电压向下拉,就能导通。
|
||||||
|
|
||||||
|
### 2.2 2只低边NMOS
|
||||||
|
|
||||||
|
低边使用2只NMOS:
|
||||||
|
|
||||||
|
- 左侧NMOS负责把输出端`C`连接到GND;
|
||||||
|
- 右侧NMOS负责把输出端`W`连接到GND。
|
||||||
|
|
||||||
|
低边NMOS的源极接地,MCU输出高电平后比较容易直接驱动其栅极。
|
||||||
|
|
||||||
|
### 2.3 2只PMOS驱动NMOS
|
||||||
|
|
||||||
|
MCU通常只有3.3V输出,不能直接把接在12~24V电源上的PMOS栅极拉到合适电位,所以增加2只小信号NMOS:
|
||||||
|
|
||||||
|
- 左侧驱动NMOS负责下拉左侧PMOS栅极;
|
||||||
|
- 右侧驱动NMOS负责下拉右侧PMOS栅极。
|
||||||
|
|
||||||
|
这2只小MOS不直接承受LED主电流,只负责PMOS栅极的充电和放电控制。
|
||||||
|
|
||||||
|
### 2.4 负载是反向并联双色LED
|
||||||
|
|
||||||
|
双色LED连接在`C`、`W`两个H桥输出端之间。两种颜色的LED芯片方向相反:
|
||||||
|
|
||||||
|
- 电流从`C`流向`W`时,点亮一种颜色;
|
||||||
|
- 电流从`W`流向`C`时,点亮另一种颜色;
|
||||||
|
- 两个方向快速分时工作时,肉眼看到混合色或中性光。
|
||||||
|
|
||||||
|
H桥的作用不是简单提供两路独立正电压,而是改变流过双色LED的电流方向。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 两路输入如何控制H桥
|
||||||
|
|
||||||
|
本文把两路控制信号称为:
|
||||||
|
|
||||||
|
- `PWM_W`:驱动Q7和对角线上的Q10,形成`C→W`电流;
|
||||||
|
- `PWM_C`:驱动Q8和对角线上的Q9,形成`W→C`电流。
|
||||||
|
|
||||||
|
按照当前交叉驱动结构,一路信号会同时控制一只高边PMOS和对角线上的一只低边NMOS。
|
||||||
|
|
||||||
|
> `PWM_C`、`PWM_W`是电路网络名称。最终点亮暖色还是冷色,还取决于双色LED的实际安装方向。
|
||||||
|
|
||||||
|
### 3.1 PWM_W有效
|
||||||
|
|
||||||
|
`PWM_W=1、PWM_C=0`时:
|
||||||
|
|
||||||
|
- Q7导通并下拉Q1的栅极,使左侧高边PMOS Q1导通;
|
||||||
|
- 对角线上的右侧低边NMOS Q10导通;
|
||||||
|
- `C`端接近电源;
|
||||||
|
- `W`端接近GND;
|
||||||
|
- 电流方向为`电源 → C → LED → W → GND`。
|
||||||
|
|
||||||
|
此时点亮一个颜色。
|
||||||
|
|
||||||
|
### 3.2 PWM_C有效
|
||||||
|
|
||||||
|
`PWM_C=1、PWM_W=0`时:
|
||||||
|
|
||||||
|
- Q8导通并下拉Q2的栅极,使右侧高边PMOS Q2导通;
|
||||||
|
- 对角线上的左侧低边NMOS Q9导通;
|
||||||
|
- `W`端接近电源;
|
||||||
|
- `C`端接近GND;
|
||||||
|
- 电流方向为`电源 → W → LED → C → GND`。
|
||||||
|
|
||||||
|
此时点亮另一个颜色。
|
||||||
|
|
||||||
|
### 3.3 两路均为低电平
|
||||||
|
|
||||||
|
`PWM_C=0、PWM_W=0`时:
|
||||||
|
|
||||||
|
- 两只高边PMOS关闭;
|
||||||
|
- 两只低边NMOS关闭;
|
||||||
|
- H桥处于关闭状态;
|
||||||
|
- LED没有持续驱动电流。
|
||||||
|
|
||||||
|
换向时必须先进入这个状态。
|
||||||
|
|
||||||
|
### 3.4 两路均为高电平
|
||||||
|
|
||||||
|
`PWM_C=1、PWM_W=1`是禁止状态。
|
||||||
|
|
||||||
|
此时两组对角桥臂同时收到导通命令,可能导致同一桥臂的上管和下管同时导通,形成:
|
||||||
|
|
||||||
|
```text
|
||||||
|
电源 → 上管 → 下管 → GND
|
||||||
|
```
|
||||||
|
|
||||||
|
这条路径几乎没有LED负载限流,会产生很大的直通电流,可能造成:
|
||||||
|
|
||||||
|
- 电源异响;
|
||||||
|
- MOS管快速发热;
|
||||||
|
- 电源电压跌落;
|
||||||
|
- MCU复位或蓝牙掉线;
|
||||||
|
- MOS管损坏;
|
||||||
|
- PCB走线或电源器件损坏。
|
||||||
|
|
||||||
|
控制真值表如下:
|
||||||
|
|
||||||
|
| PWM_C | PWM_W | H桥状态 | 结果 |
|
||||||
|
|---:|---:|---|---|
|
||||||
|
| 0 | 0 | 全部关闭 | 安全关闭/换向死区 |
|
||||||
|
| 0 | 1 | C高、W低 | 电流从C流向W |
|
||||||
|
| 1 | 0 | W高、C低 | 电流从W流向C |
|
||||||
|
| 1 | 1 | 禁止状态 | 可能发生桥臂直通 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 为什么换向必须设置死区
|
||||||
|
|
||||||
|
MOS管不是收到控制电平后立即完成导通或关断。栅极电容、米勒平台、驱动电阻和PCB寄生参数都会产生延迟。
|
||||||
|
|
||||||
|
如果直接执行:
|
||||||
|
|
||||||
|
```text
|
||||||
|
PWM_C有效 → PWM_W有效
|
||||||
|
```
|
||||||
|
|
||||||
|
可能出现:
|
||||||
|
|
||||||
|
- 原方向的PMOS和NMOS还没有完全关闭;
|
||||||
|
- 新方向的PMOS和NMOS已经开始导通;
|
||||||
|
- 两个方向在很短时间内重叠;
|
||||||
|
- H桥形成瞬间直通。
|
||||||
|
|
||||||
|
正确换向顺序应为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
方向C导通 → 输出00 → 等待死区 → 方向W导通
|
||||||
|
方向W导通 → 输出00 → 等待死区 → 方向C导通
|
||||||
|
```
|
||||||
|
|
||||||
|
死区时间不能只根据软件定时值决定,必须结合实际MOS管栅极波形测量。对于本类低频LED PWM,可以先设置较保守的死区进行验证,再根据示波器结果缩短。
|
||||||
|
|
||||||
|
需要注意:
|
||||||
|
|
||||||
|
- 死区太短,可能发生直通;
|
||||||
|
- 死区太长,会降低最大有效占空比和LED峰值亮度;
|
||||||
|
- 调高PWM频率后,相同死区占整个周期的比例会变大;
|
||||||
|
- PMOS上拉电阻变大后,通常需要重新确认死区是否足够。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 先认识PMOS的三个引脚
|
||||||
|
|
||||||
|
PMOS有三个主要引脚:
|
||||||
|
|
||||||
|
- `S`:源极(Source),本电路接12V或24V电源;
|
||||||
|
- `G`:栅极(Gate),用于控制PMOS导通和关断;
|
||||||
|
- `D`:漏极(Drain),连接H桥输出端。
|
||||||
|
|
||||||
|
PMOS是否导通,主要取决于栅源电压:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VGS = VG - VS
|
||||||
|
```
|
||||||
|
|
||||||
|
其中:
|
||||||
|
|
||||||
|
- `VG`是栅极对地电压;
|
||||||
|
- `VS`是源极对地电压。
|
||||||
|
|
||||||
|
假设源极接24V:
|
||||||
|
|
||||||
|
| 栅极电压VG | 栅源电压VGS | PMOS状态 |
|
||||||
|
|---:|---:|---|
|
||||||
|
| 24V | 0V | 关断 |
|
||||||
|
| 20V | -4V | 开始较明显导通 |
|
||||||
|
| 14V | -10V | 充分导通 |
|
||||||
|
| 12V | -12V | 充分导通 |
|
||||||
|
| 0V | -24V | 超过多数PMOS的栅源耐压,危险 |
|
||||||
|
|
||||||
|
> 注意:数据手册中的`VGS(th)`是“刚开始有很小电流”的开启阈值,不代表MOS管已经充分导通。
|
||||||
|
|
||||||
|
以SL60P03D为例:
|
||||||
|
|
||||||
|
- `VGS(th)`约为-1.0V至-2.2V;
|
||||||
|
- 导通电阻通常在`VGS=-4.5V`或`VGS=-10V`条件下标定;
|
||||||
|
- 栅源极绝对最大耐压为`±20V`。
|
||||||
|
|
||||||
|
所以“20V”不是开启阈值,而是不能超过的栅源极极限耐压。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 6. 上拉电阻和下拉电阻分别做什么
|
||||||
|
|
||||||
|
为避免受到原理图位号差异影响,本文统一使用下面的名称:
|
||||||
|
|
||||||
|
- `RUP`:PMOS栅极到源极(电源)的上拉电阻;
|
||||||
|
- `RDOWN`:PMOS栅极到地的下拉电阻;
|
||||||
|
- `DZ`:跨接在PMOS栅极和源极之间的稳压管;
|
||||||
|
- `QDRV`:把PMOS栅极向地拉低的小信号MOS管。
|
||||||
|
|
||||||
|
简化结构如下:
|
||||||
|
|
||||||
|
```text
|
||||||
|
电源12V/24V
|
||||||
|
|
|
||||||
|
+--------- PMOS源极S
|
||||||
|
|
|
||||||
|
RUP
|
||||||
|
|
|
||||||
|
+--------- PMOS栅极G
|
||||||
|
|
|
||||||
|
RDOWN
|
||||||
|
|
|
||||||
|
QDRV
|
||||||
|
|
|
||||||
|
GND
|
||||||
|
|
||||||
|
DZ稳压管跨接在PMOS的S和G之间。
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.1 PMOS关断过程
|
||||||
|
|
||||||
|
当`QDRV`关闭后,下拉路径断开,`RUP`把PMOS栅极充电到源极电压:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VG ≈ VS
|
||||||
|
VGS ≈ 0V
|
||||||
|
```
|
||||||
|
|
||||||
|
PMOS关断。
|
||||||
|
|
||||||
|
因此,`RUP`越小,给栅极电容充电的电流越大,PMOS通常关断得越快。
|
||||||
|
|
||||||
|
### 6.2 PMOS导通过程
|
||||||
|
|
||||||
|
当`QDRV`导通后,`RUP`和`RDOWN`形成从电源到地的分压回路,栅极电压下降,PMOS得到负的`VGS`并导通。
|
||||||
|
|
||||||
|
因此:
|
||||||
|
|
||||||
|
- `RUP`太小:关断快,但栅极不容易被拉低,PMOS导通电压可能不足;
|
||||||
|
- `RUP`太大:PMOS容易得到较大的负`VGS`,但栅极充电慢,关断时间增加;
|
||||||
|
- `RDOWN`太小:PMOS导通更充分,但电流和电阻功耗增加;
|
||||||
|
- `RDOWN`太大:功耗降低,但PMOS导通电压减小。
|
||||||
|
|
||||||
|
两个电阻必须综合考虑,不能只追求其中一个方向。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 7. 没有稳压管时如何计算
|
||||||
|
|
||||||
|
先忽略稳压管,假设`QDRV`已经完全导通。
|
||||||
|
|
||||||
|
栅极电压为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VG = VCC × RDOWN / (RUP + RDOWN)
|
||||||
|
```
|
||||||
|
|
||||||
|
PMOS栅源电压的绝对值为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
|VGS| = VCC × RUP / (RUP + RDOWN)
|
||||||
|
```
|
||||||
|
|
||||||
|
回路电流为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
I = VCC / (RUP + RDOWN)
|
||||||
|
```
|
||||||
|
|
||||||
|
两个电阻的功耗分别为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
PUP = I² × RUP
|
||||||
|
PDOWN = I² × RDOWN
|
||||||
|
```
|
||||||
|
|
||||||
|
### 7.1 当前原理图:24V、上拉2.4kΩ、下拉3kΩ
|
||||||
|
|
||||||
|
```text
|
||||||
|
VCC = 24V
|
||||||
|
RUP = 2.4kΩ
|
||||||
|
RDOWN = 3kΩ
|
||||||
|
```
|
||||||
|
|
||||||
|
计算结果:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VG = 24 × 3 / (2.4 + 3) ≈ 13.33V
|
||||||
|
VGS = 13.33 - 24 ≈ -10.67V
|
||||||
|
I = 24 / 5.4k ≈ 4.44mA
|
||||||
|
PUP = I² × 2.4k ≈ 47mW
|
||||||
|
PDOWN = I² × 3k ≈ 59mW
|
||||||
|
```
|
||||||
|
|
||||||
|
所以栅极并不会被拉到0V,而是被两个电阻分压到约13.33V。
|
||||||
|
|
||||||
|
PMOS得到约-10.67V的栅源电压,能够充分导通。这个数值没有达到12V稳压管的击穿电压,因此D1/D2在稳定导通状态下基本不工作,主要用于处理换向尖峰。
|
||||||
|
|
||||||
|
### 7.2 当前原理图:12V、上拉2.4kΩ、下拉3kΩ
|
||||||
|
|
||||||
|
同样的电阻在12V输入下:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VG = 12 × 3 / (2.4 + 3) ≈ 6.67V
|
||||||
|
VGS = 6.67 - 12 ≈ -5.33V
|
||||||
|
I = 12 / 5.4k ≈ 2.22mA
|
||||||
|
PUP ≈ 12mW
|
||||||
|
PDOWN ≈ 15mW
|
||||||
|
```
|
||||||
|
|
||||||
|
此时PMOS仍然可以可靠导通,而且12V稳压管在正常稳定状态下不会反向击穿。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 8. 稳压管的真正作用
|
||||||
|
|
||||||
|
12V稳压管跨接在PMOS的源极和栅极之间,主要作用是限制`|VGS|`。
|
||||||
|
|
||||||
|
### 8.1 正常关断时
|
||||||
|
|
||||||
|
PMOS栅极被`RUP`拉到源极电压:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VGS ≈ 0V
|
||||||
|
```
|
||||||
|
|
||||||
|
稳压管不工作。
|
||||||
|
|
||||||
|
### 8.2 正常导通时
|
||||||
|
|
||||||
|
栅极被下拉,`|VGS|`逐渐增大。
|
||||||
|
|
||||||
|
当`|VGS|`接近稳压管的击穿电压后,稳压管开始反向导通,把`|VGS|`限制在大约12V附近。
|
||||||
|
|
||||||
|
24V输入、12V稳压管钳位时,理想状态约为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VS ≈ 24V
|
||||||
|
VG ≈ 12V
|
||||||
|
VGS ≈ -12V
|
||||||
|
```
|
||||||
|
|
||||||
|
### 8.3 换向尖峰出现时
|
||||||
|
|
||||||
|
H桥换向会受到以下因素影响:
|
||||||
|
|
||||||
|
- MOS管栅极电容;
|
||||||
|
- 米勒电容;
|
||||||
|
- PCB走线电感;
|
||||||
|
- LED和供电线路电感;
|
||||||
|
- MOS管体二极管反向恢复;
|
||||||
|
- 电源母线尖峰。
|
||||||
|
|
||||||
|
这些因素可能让`VGS`在很短时间内超过正常分压值。稳压管可以吸收部分栅源尖峰,避免PMOS栅极氧化层承受过高电压。
|
||||||
|
|
||||||
|
### 8.4 正向栅源尖峰
|
||||||
|
|
||||||
|
如果换向时栅极瞬间高于源极,稳压管会像普通二极管一样正向导通,把正向`VGS`限制在约0.7V至1V附近。
|
||||||
|
|
||||||
|
### 8.5 稳压管不能保护什么
|
||||||
|
|
||||||
|
栅源稳压管只能保护PMOS的`VGS`,不能保护PMOS的漏源极`VDS`。
|
||||||
|
|
||||||
|
例如:
|
||||||
|
|
||||||
|
- 电源为24V;
|
||||||
|
- PMOS的`VDS`额定值为-30V。
|
||||||
|
|
||||||
|
这时漏源极只有约6V的理论尖峰余量。电源母线仍需考虑:
|
||||||
|
|
||||||
|
- TVS管;
|
||||||
|
- 就近低ESR电容;
|
||||||
|
- 较短、较宽的功率走线;
|
||||||
|
- 减小H桥电流环路面积;
|
||||||
|
- 必要时使用耐压更高的MOS管。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 9. 为什么稳压管不是接上就一定能稳定在12V
|
||||||
|
|
||||||
|
稳压管必须获得足够的反向电流,才能进入比较稳定的击穿区。
|
||||||
|
|
||||||
|
为了说明稳压管为什么需要足够电流,下面使用“上拉1.2kΩ、下拉1kΩ”作为对比算例。这不是图1当前采用的2.4kΩ、3kΩ参数。
|
||||||
|
|
||||||
|
假设:
|
||||||
|
|
||||||
|
```text
|
||||||
|
VCC = 24V
|
||||||
|
VZ = 12V
|
||||||
|
RUP = 1.2kΩ
|
||||||
|
RDOWN = 1kΩ
|
||||||
|
```
|
||||||
|
|
||||||
|
钳位后栅极约为12V。
|
||||||
|
|
||||||
|
下拉电阻电流:
|
||||||
|
|
||||||
|
```text
|
||||||
|
IDOWN = 12V / 1kΩ = 12mA
|
||||||
|
```
|
||||||
|
|
||||||
|
上拉电阻电流:
|
||||||
|
|
||||||
|
```text
|
||||||
|
IUP = (24V - 12V) / 1.2kΩ = 10mA
|
||||||
|
```
|
||||||
|
|
||||||
|
稳压管电流约为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
IZ = IDOWN - IUP = 12mA - 10mA = 2mA
|
||||||
|
```
|
||||||
|
|
||||||
|
因此,1.2kΩ上拉加1kΩ下拉时,稳压管大约只有2mA电流。
|
||||||
|
|
||||||
|
这通常可以产生一定的钳位作用,但实际电压未必正好是12.00V。稳压管的标称电压、测试电流、动态电阻和温度特性需要查看具体厂家的数据手册。
|
||||||
|
|
||||||
|
如果上拉和下拉都是1kΩ:
|
||||||
|
|
||||||
|
```text
|
||||||
|
IUP = 12mA
|
||||||
|
IDOWN = 12mA
|
||||||
|
IZ ≈ 0mA
|
||||||
|
```
|
||||||
|
|
||||||
|
此时稳压管几乎没有剩余电流,不能指望它进入稳定的反向击穿状态。
|
||||||
|
|
||||||
|
对于图1当前的2.4kΩ上拉和3kΩ下拉,在24V正常导通时,计算得到`|VGS|≈10.67V`,低于12V,因此稳压管不会持续击穿。这正是更合适的状态:正常工作由电阻分压确定栅极电压,稳压管只处理异常瞬态。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 10. 为什么电阻不能只考虑关断速度
|
||||||
|
|
||||||
|
MOS管的栅极不是普通的纯电阻负载,可以把它理解为一个需要充电和放电的电容。
|
||||||
|
|
||||||
|
SL60P03D的典型参数包括:
|
||||||
|
|
||||||
|
- 输入电容`CISS`约为1988pF;
|
||||||
|
- 总栅极电荷`Qg`约为35nC(特定测试条件下);
|
||||||
|
- 米勒电荷`Qgd`约为8.8nC。
|
||||||
|
|
||||||
|
PMOS关断时,`RUP`负责给栅极充电。可以先用RC时间常数粗略估算:
|
||||||
|
|
||||||
|
```text
|
||||||
|
τ ≈ RUP × CISS
|
||||||
|
```
|
||||||
|
|
||||||
|
例如:
|
||||||
|
|
||||||
|
| RUP | 估算时间常数τ |
|
||||||
|
|---:|---:|
|
||||||
|
| 1.2kΩ | 约2.4μs |
|
||||||
|
| 2.2kΩ | 约4.4μs |
|
||||||
|
| 2.4kΩ | 约4.8μs |
|
||||||
|
| 3.6kΩ | 约7.2μs |
|
||||||
|
|
||||||
|
实际关断时间还受到栅极电荷、米勒平台、漏极电压变化和PCB寄生参数影响,不能只用一个RC公式定论。
|
||||||
|
|
||||||
|
### 10.1 RUP太大
|
||||||
|
|
||||||
|
可能产生:
|
||||||
|
|
||||||
|
- PMOS关断变慢;
|
||||||
|
- 换向时上管尚未完全关断,下管已经开启;
|
||||||
|
- H桥上下管短暂直通;
|
||||||
|
- 电源出现大电流尖峰;
|
||||||
|
- MOS管异常发热;
|
||||||
|
- 电路发出异响;
|
||||||
|
- 严重时损坏MOS管或电源。
|
||||||
|
|
||||||
|
### 10.2 RUP太小
|
||||||
|
|
||||||
|
可能产生:
|
||||||
|
|
||||||
|
- PMOS关断速度加快;
|
||||||
|
- 但下拉时大量电流被RUP分走;
|
||||||
|
- 栅极下拉不够,PMOS的负`VGS`不足;
|
||||||
|
- PMOS没有充分导通,导通电阻增大;
|
||||||
|
- 驱动回路静态功耗增加;
|
||||||
|
- 电阻和驱动管温升增加。
|
||||||
|
|
||||||
|
所以“上拉电阻越小越安全”并不成立。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 11. 电阻功耗不能只按照死区时间计算
|
||||||
|
|
||||||
|
这是非常容易出现的误区。
|
||||||
|
|
||||||
|
死区时间,例如25μs或50μs,表示换向时两边都关闭的保护时间。它不代表上拉、下拉电阻只通电25μs或50μs。
|
||||||
|
|
||||||
|
当PMOS保持导通时:
|
||||||
|
|
||||||
|
- `QDRV`持续导通;
|
||||||
|
- `RUP`、`RDOWN`和稳压管可能持续有电流;
|
||||||
|
- 电阻功耗会持续整个PMOS导通阶段。
|
||||||
|
|
||||||
|
因此必须分别检查:
|
||||||
|
|
||||||
|
1. 正常导通期间的连续或平均功耗;
|
||||||
|
2. 换向尖峰期间的瞬时脉冲功耗。
|
||||||
|
|
||||||
|
### 11.1 对比算例:24V钳位在12V、RUP=1.2kΩ、RDOWN=1kΩ
|
||||||
|
|
||||||
|
钳位时:
|
||||||
|
|
||||||
|
```text
|
||||||
|
PUP = 12² / 1.2k ≈ 120mW
|
||||||
|
PDOWN = 12² / 1k ≈ 144mW
|
||||||
|
PZ = 12V × 2mA ≈ 24mW
|
||||||
|
```
|
||||||
|
|
||||||
|
普通0603电阻常见连续额定功率约为0.1W,但不同厂家、环境温度和PCB焊盘条件会有差异。
|
||||||
|
|
||||||
|
因此:
|
||||||
|
|
||||||
|
- 120mW和144mW不能简单地当成“只有50μs”;
|
||||||
|
- 如果PMOS长时间保持导通,电阻可能接近连续承受该功耗;
|
||||||
|
- 建议使用0805封装,或使用多个电阻分担功耗;
|
||||||
|
- 最终必须查看所选电阻的数据手册和降额曲线。
|
||||||
|
|
||||||
|
图1当前采用2.4kΩ上拉和3kΩ下拉,24V稳定工作时功耗分别约为47mW和59mW,不会出现上述持续钳位功耗;但0603电阻仍应考虑环境温度和功率降额。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 12. 取消稳压管时如何选择电阻
|
||||||
|
|
||||||
|
如果决定不安装稳压管,就必须完全依靠电阻分压限制`VGS`。
|
||||||
|
|
||||||
|
设计时应检查最坏情况:
|
||||||
|
|
||||||
|
```text
|
||||||
|
|VGS|max = VCC,max × RUP,max / (RUP,max + RDOWN,min)
|
||||||
|
```
|
||||||
|
|
||||||
|
必须同时考虑:
|
||||||
|
|
||||||
|
- 电源最高电压;
|
||||||
|
- 电源启动和负载突卸尖峰;
|
||||||
|
- 电阻误差;
|
||||||
|
- 温度;
|
||||||
|
- 驱动管导通压降;
|
||||||
|
- PCB寄生参数。
|
||||||
|
|
||||||
|
### 12.1 同时兼容12V和24V的参考值
|
||||||
|
|
||||||
|
可以考虑:
|
||||||
|
|
||||||
|
```text
|
||||||
|
RUP = 2.4kΩ
|
||||||
|
RDOWN = 3kΩ
|
||||||
|
```
|
||||||
|
|
||||||
|
计算结果:
|
||||||
|
|
||||||
|
| 输入电压 | 栅源电压VGS | 回路电流 |
|
||||||
|
|---:|---:|---:|
|
||||||
|
| 12V | 约-5.33V | 约2.22mA |
|
||||||
|
| 24V | 约-10.67V | 约4.44mA |
|
||||||
|
|
||||||
|
24V时电阻功耗:
|
||||||
|
|
||||||
|
```text
|
||||||
|
PUP ≈ 47mW
|
||||||
|
PDOWN ≈ 59mW
|
||||||
|
```
|
||||||
|
|
||||||
|
这个组合具有以下特点:
|
||||||
|
|
||||||
|
- 12V输入时仍能获得约-5.33V驱动;
|
||||||
|
- 24V输入时约为-10.67V;
|
||||||
|
- 正常功耗低于1.2kΩ加1kΩ方案;
|
||||||
|
- 2.4kΩ上拉的关断速度仍然较快;
|
||||||
|
- 不需要依靠稳压管在正常工作时持续击穿。
|
||||||
|
|
||||||
|
即使使用这个分压,保留稳压管仍然有价值:它在正常工作时不导通,只在异常尖峰时保护PMOS。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 13. 两种方案对比
|
||||||
|
|
||||||
|
### 方案A:电阻分压加稳压管
|
||||||
|
|
||||||
|
优点:
|
||||||
|
|
||||||
|
- 对栅源尖峰有额外保护;
|
||||||
|
- 元件误差或异常状态下更安全;
|
||||||
|
- 可以限制`VGS`不超过约12V。
|
||||||
|
|
||||||
|
缺点:
|
||||||
|
|
||||||
|
- 必须保证稳压管具有合适的工作电流;
|
||||||
|
- 如果设计成稳压管持续击穿,会增加静态功耗;
|
||||||
|
- 电阻功耗和稳压管功耗都需要核算。
|
||||||
|
|
||||||
|
适合:
|
||||||
|
|
||||||
|
- 24V供电;
|
||||||
|
- H桥换向尖峰明显;
|
||||||
|
- 对可靠性要求较高;
|
||||||
|
- PCB空间允许增加保护器件。
|
||||||
|
|
||||||
|
### 方案B:只使用电阻分压
|
||||||
|
|
||||||
|
优点:
|
||||||
|
|
||||||
|
- 元件少;
|
||||||
|
- 不存在稳压管持续工作产生的额外功耗;
|
||||||
|
- 参数计算直观。
|
||||||
|
|
||||||
|
缺点:
|
||||||
|
|
||||||
|
- 失去栅源尖峰钳位;
|
||||||
|
- 对电源波动、电阻误差和PCB寄生参数更敏感;
|
||||||
|
- 上拉电阻开路等故障可能让`VGS`超过额定值。
|
||||||
|
|
||||||
|
适合:
|
||||||
|
|
||||||
|
- 输入电压范围明确;
|
||||||
|
- 电源尖峰受到良好控制;
|
||||||
|
- 已经通过示波器确认`VGS`安全;
|
||||||
|
- 有足够的设计余量。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 14. 本电路的建议
|
||||||
|
|
||||||
|
### 14.1 如果保留12V稳压管
|
||||||
|
|
||||||
|
建议:
|
||||||
|
|
||||||
|
- 不要只根据“关断越快越好”无限减小上拉电阻;
|
||||||
|
- 计算稳压管电流,确认能够形成有效钳位;
|
||||||
|
- 按整个PMOS导通时间核算电阻平均功耗;
|
||||||
|
- 对超过或接近0.1W的电阻优先使用0805;
|
||||||
|
- 用示波器测量真实`VGS`,确认导通时约为-10V至-12V,关断时回到0V。
|
||||||
|
|
||||||
|
### 14.2 如果取消稳压管
|
||||||
|
|
||||||
|
12V至24V输入可以先测试:
|
||||||
|
|
||||||
|
```text
|
||||||
|
RUP = 2.4kΩ
|
||||||
|
RDOWN = 3kΩ
|
||||||
|
```
|
||||||
|
|
||||||
|
但必须满足:
|
||||||
|
|
||||||
|
- 实测最大负`VGS`有足够余量;
|
||||||
|
- 实测正向和反向尖峰没有接近`±20V`;
|
||||||
|
- 电源母线已经做好TVS和就近电容;
|
||||||
|
- PMOS能在下管开启前完全关断;
|
||||||
|
- 保留足够的硬件或软件死区。
|
||||||
|
|
||||||
|
### 14.3 关于死区
|
||||||
|
|
||||||
|
死区的最终取值不能仅凭计算,应根据示波器实测决定。
|
||||||
|
|
||||||
|
至少同时测量:
|
||||||
|
|
||||||
|
- 上管PMOS的`VGS`;
|
||||||
|
- 下管NMOS的`VGS`;
|
||||||
|
- H桥输出节点;
|
||||||
|
- 24V母线电压;
|
||||||
|
- 条件允许时测量桥臂电流。
|
||||||
|
|
||||||
|
判断标准是:
|
||||||
|
|
||||||
|
> 下管开始导通之前,对应上管必须已经退出导通区,并且换向过程中没有异常母线电流尖峰。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 15. 初学者常见误区
|
||||||
|
|
||||||
|
### 误区一:PMOS的20V是开启阈值
|
||||||
|
|
||||||
|
错误。20V通常是栅源极最大耐压。真正的`VGS(th)`一般只有约1V至3V,但这个电压只能让MOS管刚刚开始导通。
|
||||||
|
|
||||||
|
### 误区二:栅极下拉后一定是0V
|
||||||
|
|
||||||
|
错误。如果存在上拉和下拉电阻,栅极由两个电阻分压,不会自然等于0V。
|
||||||
|
|
||||||
|
### 误区三:装了12V稳压管,VGS就一定是-12V
|
||||||
|
|
||||||
|
错误。稳压管必须获得足够的反向电流,实际钳位电压还受到电流、温度和器件误差影响。
|
||||||
|
|
||||||
|
### 误区四:上拉电阻越小,电路越安全
|
||||||
|
|
||||||
|
错误。上拉电阻减小会加快关断,但也会降低PMOS导通时的负`VGS`,并增加静态功耗。
|
||||||
|
|
||||||
|
### 误区五:电阻的高功耗只持续死区时间
|
||||||
|
|
||||||
|
错误。PMOS导通期间,分压回路可能持续有电流。必须按照实际占空比和最坏工作状态核算平均功耗。
|
||||||
|
|
||||||
|
### 误区六:栅源稳压管可以保护整个MOS管
|
||||||
|
|
||||||
|
错误。它主要保护`VGS`,不能代替24V母线TVS,也不能阻止`VDS`超过MOS管额定值。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 16. 最终检查清单
|
||||||
|
|
||||||
|
原理图确定后,至少完成以下检查:
|
||||||
|
|
||||||
|
- [ ] 确认PMOS的`VGS(th)`、推荐驱动电压和`VGS(max)`;
|
||||||
|
- [ ] 计算12V和24V下的正常`VGS`;
|
||||||
|
- [ ] 计算最高电源电压和电阻误差下的最坏`VGS`;
|
||||||
|
- [ ] 计算上拉、下拉电阻连续功耗;
|
||||||
|
- [ ] 计算稳压管正常电流和功耗;
|
||||||
|
- [ ] 检查0603/0805电阻的额定功率和降额曲线;
|
||||||
|
- [ ] 测量PMOS栅极对源极波形,而不是只测栅极对地;
|
||||||
|
- [ ] 检查换向时是否有正向或反向`VGS`尖峰;
|
||||||
|
- [ ] 检查上下管是否发生交叉导通;
|
||||||
|
- [ ] 验证`PWM_C=1、PWM_W=1`在软硬件中都不会出现;
|
||||||
|
- [ ] 验证每次方向切换都经过`00`关闭状态;
|
||||||
|
- [ ] 检查24V母线是否超过PMOS的`VDS`额定值;
|
||||||
|
- [ ] 高温、低温、最低输入和最高输入条件下重复测试。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 17. 总结
|
||||||
|
|
||||||
|
PMOS栅极驱动电阻的选择,本质上是在以下四项之间寻找平衡:
|
||||||
|
|
||||||
|
1. PMOS必须得到足够的负`VGS`,保证充分导通;
|
||||||
|
2. PMOS必须快速回到`VGS≈0V`,保证及时关断;
|
||||||
|
3. 分压回路的电流和电阻功耗不能过大;
|
||||||
|
4. 栅源电压和换向尖峰不能超过MOS管额定值。
|
||||||
|
|
||||||
|
稳压管的核心作用是保护PMOS栅源极,而不是替代电阻分压,也不是控制死区。合理的设计应先用电阻比例确定正常工作点,再用稳压管处理异常和瞬态过压,最后通过示波器实测确认。
|
||||||
|
|
||||||
|
对于这套12~24V、2P2N主桥加2只驱动MOS的双色LED电路,还必须始终遵守两个基本原则:
|
||||||
|
|
||||||
|
1. `PWM_C`和`PWM_W`不能同时为高电平;
|
||||||
|
2. 两个电流方向切换时,必须先输出`00`,等待确认安全的死区后再开启另一方向。
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
# DWM22 黑盒用户测试文档
|
||||||
|
|
||||||
|
## 1. 文档信息
|
||||||
|
|
||||||
|
| 项目 | 内容 |
|
||||||
|
| --- | --- |
|
||||||
|
| 产品名称 | DWM22 |
|
||||||
|
| 测试类型 | 用户黑盒功能测试 |
|
||||||
|
| 固件校验码 | `0F9DA5A0` |
|
||||||
|
| 固件提交 | `ee68f37 DWM22量产测试` |
|
||||||
|
| APP | Ultra Life |
|
||||||
|
| 测试日期 | |
|
||||||
|
| 测试人员 | |
|
||||||
|
| 样机编号 | |
|
||||||
|
|
||||||
|
> 测试人员只根据实际操作和灯光表现判断结果,不需要查看程序、波形或内部数据。
|
||||||
|
|
||||||
|
## 2. 测试准备
|
||||||
|
|
||||||
|
- DWM22 测试样机 1 台。
|
||||||
|
- 双色 LED 灯板及 12~24V 配套电源。
|
||||||
|
- 安装最新版 Ultra Life APP 的手机 1 台。
|
||||||
|
- 433 遥控器至少 2 个;测试 5 路记忆时准备 6 个。
|
||||||
|
- 遥控距离测试场地:无遮挡、直线距离大于 12 米。
|
||||||
|
- 每个用例测试完成后,在“结果”栏填写:通过或失败。
|
||||||
|
|
||||||
|
## 3. 产品模式说明
|
||||||
|
|
||||||
|
DWM22 共 14 个产品模式,固定顺序如下:
|
||||||
|
|
||||||
|
**暖光静态 → 冷光静态 → 中性光静态 → 暖光呼吸 → 冷光呼吸 → 中性光呼吸 → 三色呼吸 → 暖冷连续渐变 → 暖冷中性渐变 → 暖光闪烁 → 冷光闪烁 → 中性光闪烁 → 暖冷中性跳变 → 三色闪烁**
|
||||||
|
|
||||||
|
- 模式 1~3 为静态模式,可以调节亮度。
|
||||||
|
- 模式 4~14 为动态模式,可以调节亮度和速度。
|
||||||
|
- 遥控器“模式+”按上述顺序向后切换,“模式-”按相反顺序返回。
|
||||||
|
- 到达模式 14 后继续按“模式+”,应停留在模式 14,不从头循环。
|
||||||
|
- 到达模式 1 后继续按“模式-”,应停留在模式 1,不跳到模式 14。
|
||||||
|
- APP 色温环属于自定义静态色温,不占用以上 14 个模式编号。
|
||||||
|
|
||||||
|
| 顺序 | 模式名称 | 产品效果说明 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| 1 | 暖光静态 | 仅暖光常亮 |
|
||||||
|
| 2 | 冷光静态 | 仅冷光常亮 |
|
||||||
|
| 3 | 中性光静态 | 暖光和冷光混合形成中性光 |
|
||||||
|
| 4 | 暖光呼吸 | 暖光由暗到亮、再由亮到暗循环 |
|
||||||
|
| 5 | 冷光呼吸 | 冷光由暗到亮、再由亮到暗循环 |
|
||||||
|
| 6 | 中性光呼吸 | 暖冷两路保持中性比例同步呼吸 |
|
||||||
|
| 7 | 三色呼吸 | 暖光、冷光、中性光依次完成呼吸 |
|
||||||
|
| 8 | 暖冷连续渐变 | 暖光与冷光互补变化,一个降低时另一个升高,全程不断光 |
|
||||||
|
| 9 | 暖冷中性渐变 | 在暖光、冷光和中性光之间平滑渐变,颜色衔接时保持亮光 |
|
||||||
|
| 10 | 暖光闪烁 | 暖光按设定速度亮灭 |
|
||||||
|
| 11 | 冷光闪烁 | 冷光按设定速度亮灭 |
|
||||||
|
| 12 | 中性光闪烁 | 中性光按设定速度亮灭 |
|
||||||
|
| 13 | 暖冷中性跳变 | 暖光、冷光、中性光直接切换,不做渐变 |
|
||||||
|
| 14 | 三色闪烁 | 暖光、冷光、中性光依次闪烁,中间包含熄灭节拍 |
|
||||||
|
|
||||||
|
## 4. 基本功能
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 01 | 接通电源 | 灯具能在正常时间内点亮;无长时间不亮、异常闪烁、异响或发热 | | |
|
||||||
|
| 02 | 使用遥控器或 APP 开灯、关灯 | 开关响应正确,开关过程柔和;关灯后两路 LED 均完全熄灭 | | |
|
||||||
|
| 03 | 连续开关灯 10 次 | 每次均正常响应,无死机、失控或蓝牙广播消失 | | |
|
||||||
|
| 04 | 在暖光、冷光、中性光之间反复切换 | 颜色正确,过渡柔和,无突然增亮、突然变暗或异常颜色闪现 | | |
|
||||||
|
| 05 | 从最低亮度逐级调到最高亮度,再调回最低亮度 | 亮度变化连续、均匀,无明显顿挫、抖动或提前熄灭 | | |
|
||||||
|
| 06 | 中性光在低亮度下持续观察 30 秒 | 无肉眼可见抖动,两路混色比例稳定 | | |
|
||||||
|
|
||||||
|
## 5. 遥控器对码
|
||||||
|
|
||||||
|
对码操作:连接 DWM22,在 APP“更多”页面点击“遥控器对码”,在 5 秒倒计时内长按遥控器“亮度+”按键。
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 07 | 使用未对码遥控器直接控制灯具 | 灯具不响应 | | |
|
||||||
|
| 08 | 在 APP 中进入“遥控器对码”,长按遥控器“亮度+” | 灯具给出对码闪烁反馈;APP 显示“对码成功”和已对码数量 | | |
|
||||||
|
| 09 | 对码成功后测试遥控器开关、模式和亮度按键 | 所有按键均能正常控制灯具,短按一次即可响应 | | |
|
||||||
|
| 10 | 打开对码页面但不操作遥控器,等待 5 秒 | 对码自动结束,APP 提示未收到有效信号;原有遥控器不受影响 | | |
|
||||||
|
| 11 | 将已经对码的同一个遥控器再次对码 | 可以提示对码成功,但已对码数量不增加,不重复占用位置 | | |
|
||||||
|
| 12 | 依次对码 5 个不同遥控器 | 5 个遥控器都能控制灯具,APP 显示 `5/5` | | |
|
||||||
|
| 13 | 已有 5 个遥控器后,再对码第 6 个遥控器 | 第 6 个遥控器可以使用;最早对码的遥控器被替换,其余最近 4 个仍可使用 | | |
|
||||||
|
| 14 | 对码成功后切断电源,重新上电 | 已对码遥控器仍能使用,对码数据不会因断电丢失 | | |
|
||||||
|
|
||||||
|
## 6. 遥控器清码
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 15 | APP“更多”页面点击“清除遥控器” | 出现二次确认窗口,不会直接清码 | | |
|
||||||
|
| 16 | 在确认窗口点击“取消” | 遥控器数据保留,原遥控器仍可使用 | | |
|
||||||
|
| 17 | 再次进入清码并点击“清除” | 灯具给出清码反馈,APP 提示“清码成功”,已对码数量变为 0 | | |
|
||||||
|
| 18 | 清码后测试全部旧遥控器 | 所有旧遥控器均不能控制灯具 | | |
|
||||||
|
| 19 | 清码后重新对码一个遥控器 | 可以正常重新对码并控制灯具 | | |
|
||||||
|
| 20 | 清码后断电重启,再测试旧遥控器 | 清码结果被记忆,旧遥控器仍不能控制灯具 | | |
|
||||||
|
|
||||||
|
## 7. 遥控距离
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 21 | 在无遮挡环境下,将遥控器与灯具距离拉到 12 米以上 | 在大于 12 米的位置仍可正常控制,判定距离合格 | | 实测距离:____m |
|
||||||
|
| 22 | 在 12 米位置,分别短按开关、模式+、模式-、亮度+、亮度-各 10 次 | 按键能可靠响应,不能依赖连续按两次或刻意延长短按时间;建议每个按键至少 9 次一次响应 | | |
|
||||||
|
| 23 | 改变遥控器朝向,在 12 米位置重复测试 | 不应频繁失控;正常手持方向下可以稳定操作 | | |
|
||||||
|
|
||||||
|
## 8. 模式顺序测试
|
||||||
|
|
||||||
|
先在 APP 中选择模式 1,然后使用遥控器“模式+”按顺序测试到模式 14,每个模式至少观察 20 秒。之后使用“模式-”从模式 14 反向测试回模式 1。
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| M01 | APP 依次点击模式 1~14 | 实际效果与 APP 模式名称一致,顺序正确 | | |
|
||||||
|
| M02 | 从模式 1 开始,遥控短按“模式+”13次 | 严格按照 1→2→…→14 切换,每次只前进一个模式 | | |
|
||||||
|
| M03 | 在模式 14 再按“模式+” | 保持模式 14,不循环回模式 1 | | |
|
||||||
|
| M04 | 从模式 14 开始,遥控短按“模式-”13次 | 严格按照 14→13→…→1 返回,每次只后退一个模式 | | |
|
||||||
|
| M05 | 在模式 1 再按“模式-” | 保持模式 1,不跳转到模式 14 | | |
|
||||||
|
| M06 | 对比 APP 选中模式、灯光效果和遥控切换结果 | 三者始终对应,不出现错位一个模式的情况 | | |
|
||||||
|
|
||||||
|
| 模式 | 效果 | 主要检查内容 | 结果 |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| 1 | 暖光静态 | 暖光正确,亮度稳定 | |
|
||||||
|
| 2 | 冷光静态 | 冷光正确,亮度稳定 | |
|
||||||
|
| 3 | 中性光静态 | 两路混色正确,无抖动 | |
|
||||||
|
| 4 | 暖光呼吸 | 从低到高、再从高到低,过程柔和 | |
|
||||||
|
| 5 | 冷光呼吸 | 从低到高、再从高到低,过程柔和 | |
|
||||||
|
| 6 | 中性光呼吸 | 呼吸时间与单色接近,低亮度无明显抖动,峰值亮度正常 | |
|
||||||
|
| 7 | 三色呼吸 | 暖、冷、中性依次呼吸;上一颜色降到最低后下一颜色平滑升起 | |
|
||||||
|
| 8 | 暖冷连续渐变 | 暖光降低时冷光同步升高,全程不断光、无突然跳变 | |
|
||||||
|
| 9 | 暖冷中性渐变 | 暖、冷、中性过渡自然;颜色交接时不突然变黑或异常增亮 | |
|
||||||
|
| 10 | 暖光闪烁 | 只出现暖光,节奏稳定 | |
|
||||||
|
| 11 | 冷光闪烁 | 只出现冷光,节奏稳定 | |
|
||||||
|
| 12 | 中性光闪烁 | 只出现中性光,两路比例稳定 | |
|
||||||
|
| 13 | 暖冷中性跳变 | 暖、冷、中性直接切换,颜色正确,无多余低亮度闪光 | |
|
||||||
|
| 14 | 三色闪烁 | 暖、冷、中性按设计闪烁,无错误颜色 | |
|
||||||
|
|
||||||
|
补充检查:
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 24 | 在模式 1~3 之间切换 | 使用柔和过渡,不出现最后突然亮一下的现象 | | |
|
||||||
|
| 25 | 从静态模式切换到模式 4~7 | 呼吸从低亮度开始,不会直接从最高亮度开始 | | |
|
||||||
|
| 26 | 切换到模式 10~14 | 直接进入正确动态效果,不出现其他颜色或多余低亮度脉冲 | | |
|
||||||
|
| 27 | 在动态模式下调节亮度 | 动态效果整体亮度可以调节,变化正确 | | |
|
||||||
|
| 28 | 在动态模式下调节速度 1~10 | 速度变化明显且方向正确;APP 显示值与实际效果一致 | | |
|
||||||
|
| 29 | 遥控器长按模式+或模式- | 按下时先执行一次,持续按住时约每 500ms 切换一次,不快速乱跳 | | |
|
||||||
|
|
||||||
|
## 9. 掉电记忆
|
||||||
|
|
||||||
|
### 9.1 全部带记忆
|
||||||
|
|
||||||
|
在 APP“更多 → 断电设置”中选择“全部带记忆”。
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 30 | 设置任意静态颜色、亮度,等待 2 秒后断电重启 | 恢复断电前的颜色和亮度 | | |
|
||||||
|
| 31 | 设置任意动态模式、亮度和速度,等待 2 秒后断电重启 | 恢复断电前的模式、亮度和速度 | | |
|
||||||
|
| 32 | 关灯后等待 2 秒,再切断电源并重新上电 | 恢复关灯状态,不应自行亮起 | | |
|
||||||
|
| 33 | 在中性光状态下改变亮度、模式或断电设置 | 保存过程中灯光不闪烁、不熄灭,蓝牙连接不中断 | | |
|
||||||
|
|
||||||
|
### 9.2 断电切换功能
|
||||||
|
|
||||||
|
在 APP“更多 → 断电设置”中选择“断电切换功能”。
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 34 | 设置一个容易识别的亮度,连续断电上电 4 次 | 每次上电依次为:暖光 → 冷光 → 中性光 → 暖光 | | |
|
||||||
|
| 35 | 检查每次上电后的亮度 | 三种静态颜色均保留之前设置的亮度 | | |
|
||||||
|
| 36 | 在任意动态模式或自定义色温下断电,再上电 | 仍按暖光、冷光、中性光的固定顺序轮换,不受断电前模式影响 | | |
|
||||||
|
| 37 | 选择断电切换功能后断电重启多次 | 该设置本身被记忆,不会自动恢复为“全部带记忆” | | |
|
||||||
|
| 38 | 在 APP 中来回切换两种断电设置 | 切换时灯光不闪烁、不突变,蓝牙连接保持正常 | | |
|
||||||
|
|
||||||
|
## 10. 蓝牙控制
|
||||||
|
|
||||||
|
| 编号 | 测试操作 | 预期结果 | 结果 | 备注 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| 39 | 打开 APP 搜索设备 | 能发现名称为 `DWM22` 的设备 | | |
|
||||||
|
| 40 | 连接 DWM22 | 可以正常进入 DWM22 控制界面,连接稳定 | | |
|
||||||
|
| 41 | APP 控制开灯和关灯 | 灯具正确响应,APP 状态与灯具一致 | | |
|
||||||
|
| 42 | APP 将亮度从 1 调到 100,再调回 1 | 灯光变化平滑,最低亮度可正常显示,无明显抖动或顿挫 | | |
|
||||||
|
| 43 | APP 拖动色温环,从暖光连续调到冷光并往返 | 色温连续变化,采用柔和过渡,无黑场、突变或错误颜色 | | |
|
||||||
|
| 44 | APP 依次选择 14 个模式 | 灯具效果与 APP 名称、图标和选中状态一致 | | |
|
||||||
|
| 45 | APP 调节动态亮度和速度 1~10 | 实际亮度和速度正确变化,界面数值正确 | | |
|
||||||
|
| 46 | 使用遥控器改变开关、模式、亮度或速度 | APP 已显示的设备状态能同步更新,不出现明显错乱 | | |
|
||||||
|
| 47 | 设置 APP 定时关机 | 到达设定时间后灯具自动关闭 | | |
|
||||||
|
| 48 | 蓝牙连接中关闭手机蓝牙或让设备断电 | APP 自动退出设备控制页,不停留在失效界面 | | |
|
||||||
|
| 49 | 恢复设备电源和手机蓝牙后重新连接 | 可以再次发现并连接,所有控制恢复正常 | | |
|
||||||
|
| 50 | 蓝牙连接状态下连续操作 5 分钟 | 无断链、无卡死、无控制延迟持续增大,灯光无异常抖动 | | |
|
||||||
|
|
||||||
|
## 11. 测试结论
|
||||||
|
|
||||||
|
| 项目 | 结论 |
|
||||||
|
| --- | --- |
|
||||||
|
| 对码功能 | □ 通过 □ 失败 |
|
||||||
|
| 清码功能 | □ 通过 □ 失败 |
|
||||||
|
| 遥控距离大于 12m | □ 通过 □ 失败 |
|
||||||
|
| 掉电记忆 | □ 通过 □ 失败 |
|
||||||
|
| 模式与灯光效果 | □ 通过 □ 失败 |
|
||||||
|
| 蓝牙控制 | □ 通过 □ 失败 |
|
||||||
|
| 整机测试结论 | □ 合格 □ 不合格 |
|
||||||
|
|
||||||
|
问题记录:
|
||||||
|
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
|
||||||
|
测试人员签名:________________ 日期:________________
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 287 KiB |
@@ -188,7 +188,10 @@ void scan_433();
|
|||||||
void Lock_Pwm7xd();
|
void Lock_Pwm7xd();
|
||||||
void Delay_50us();
|
void Delay_50us();
|
||||||
void Encoder_key();
|
void Encoder_key();
|
||||||
|
void rf433_clear_code(void);
|
||||||
|
uint8_t rf433_start_pairing(void);
|
||||||
|
void rf433_cancel_pairing(void);
|
||||||
|
uint8_t rf433_paired_count(void);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "pwm.h"
|
#include "pwm.h"
|
||||||
#include "rf433_decoder.h"
|
#include "rf433_decoder.h"
|
||||||
#include "timeslice.h"
|
#include "timeslice.h"
|
||||||
|
#include "usr_server.h"
|
||||||
union rf433_flag rf_flag = {0};
|
union rf433_flag rf_flag = {0};
|
||||||
unsigned char high_level_time;
|
unsigned char high_level_time;
|
||||||
unsigned char low_level_time;
|
unsigned char low_level_time;
|
||||||
@@ -96,13 +97,19 @@ static uint8_t pair_deferred_command;
|
|||||||
static uint8_t pair_deferred_res_data;
|
static uint8_t pair_deferred_res_data;
|
||||||
static uint32_t pair_deferred_receive_data;
|
static uint32_t pair_deferred_receive_data;
|
||||||
static uint8_t pair_command_replay;
|
static uint8_t pair_command_replay;
|
||||||
|
static uint8_t app_pairing_requested;
|
||||||
|
|
||||||
#define PAIR_HOLD_FRAME_COUNT 4U
|
#define PAIR_HOLD_FRAME_COUNT 4U
|
||||||
#define PAIR_FRAME_SILENCE_TICKS 100U
|
#define PAIR_FRAME_SILENCE_TICKS 100U
|
||||||
#define PAIRING_WINDOW_TICKS 50000UL
|
#define PAIRING_WINDOW_TICKS 50000UL
|
||||||
#define RF433_RELEASE_TIMEOUT_TICKS 1500U
|
#define RF433_RELEASE_TIMEOUT_TICKS 1500U
|
||||||
#define RF433_MS_TO_SAMPLE_TICKS(ms) ((uint16_t)((ms) * (1000U / RF433_DECODER_SAMPLE_US)))
|
#define RF433_MS_TO_SAMPLE_TICKS(ms) ((uint16_t)((ms) * (1000U / RF433_DECODER_SAMPLE_US)))
|
||||||
|
#define RF433_MODE_REPEAT_TICKS ((uint32_t)RF433_MS_TO_SAMPLE_TICKS(500U))
|
||||||
uint8_t long_flag_s=0;
|
uint8_t long_flag_s=0;
|
||||||
|
static volatile uint32_t rf433_sample_ticks;
|
||||||
|
static uint32_t rf433_mode_last_action_tick;
|
||||||
|
static uint8_t rf433_mode_last_key;
|
||||||
|
static uint8_t rf433_mode_action_valid;
|
||||||
|
|
||||||
void _433_fun(void);
|
void _433_fun(void);
|
||||||
|
|
||||||
@@ -253,12 +260,84 @@ static void Pairing_Candidate_Reset(void)
|
|||||||
pair_deferred_command = 0U;
|
pair_deferred_command = 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t rf433_paired_count(void)
|
||||||
|
{
|
||||||
|
uint8_t count = 0U;
|
||||||
|
uint8_t i;
|
||||||
|
|
||||||
|
for(i = 0U; i < 5U; i++)
|
||||||
|
{
|
||||||
|
if(!Pairing_Address_IsEmpty(adress_H_array[i], adress_L_array[i]))
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t rf433_start_pairing(void)
|
||||||
|
{
|
||||||
|
if(pairing_feedback_active)
|
||||||
|
{
|
||||||
|
ble_remote_event_notify(0x0DU, 0U, rf433_paired_count());
|
||||||
|
return 0U;
|
||||||
|
}
|
||||||
|
|
||||||
|
ssse = 0U;
|
||||||
|
time_5s = 1U;
|
||||||
|
pair_last_frame_sequence = rf_frame_sequence;
|
||||||
|
Pairing_Candidate_Reset();
|
||||||
|
app_pairing_requested = 1U;
|
||||||
|
ble_remote_event_notify(0x0DU, 1U, rf433_paired_count());
|
||||||
|
return 1U;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rf433_cancel_pairing(void)
|
||||||
|
{
|
||||||
|
ssse = 1U;
|
||||||
|
time_5s = PAIRING_WINDOW_TICKS + 1U;
|
||||||
|
Pairing_Candidate_Reset();
|
||||||
|
if(app_pairing_requested)
|
||||||
|
{
|
||||||
|
app_pairing_requested = 0U;
|
||||||
|
ble_remote_event_notify(0x0DU, 0U, rf433_paired_count());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void rf433_clear_code(void)
|
||||||
|
{
|
||||||
|
uint8_t i;
|
||||||
|
|
||||||
|
for(i = 0U; i < 5U; i++)
|
||||||
|
{
|
||||||
|
adress_H_array[i] = 0xffU;
|
||||||
|
adress_L_array[i] = 0xffU;
|
||||||
|
}
|
||||||
|
|
||||||
|
adress = 0U;
|
||||||
|
adress_H = 0U;
|
||||||
|
adress_L = 0U;
|
||||||
|
match_success = 0U;
|
||||||
|
ssse = 1U;
|
||||||
|
time_5s = PAIRING_WINDOW_TICKS + 1U;
|
||||||
|
Pairing_Candidate_Reset();
|
||||||
|
Pairing_Feedback_Start(200U);
|
||||||
|
app_pairing_requested = 0U;
|
||||||
|
set_TaskComps_timer(2U, 2000U);
|
||||||
|
ble_remote_event_notify(0x0EU, 1U, 0U);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void Encoder_key_NoCode(){
|
static void Encoder_key_NoCode(){
|
||||||
uint16_t times_s=0;
|
uint16_t times_s=0;
|
||||||
uint8_t pairing_data_changed=0U;
|
uint8_t pairing_data_changed=0U;
|
||||||
|
|
||||||
|
if(app_pairing_requested &&
|
||||||
|
(ssse != 0U || time_5s > PAIRING_WINDOW_TICKS))
|
||||||
|
{
|
||||||
|
app_pairing_requested = 0U;
|
||||||
|
ble_remote_event_notify(0x0DU, 0U, rf433_paired_count());
|
||||||
|
}
|
||||||
|
|
||||||
if(pair_frame_silence_ticks < 0xffU) pair_frame_silence_ticks++;
|
if(pair_frame_silence_ticks < 0xffU) pair_frame_silence_ticks++;
|
||||||
if(pair_frame_silence_ticks > PAIR_FRAME_SILENCE_TICKS)
|
if(pair_frame_silence_ticks > PAIR_FRAME_SILENCE_TICKS)
|
||||||
{
|
{
|
||||||
@@ -357,6 +436,17 @@ static void Encoder_key_NoCode(){
|
|||||||
|
|
||||||
ssse=1;
|
ssse=1;
|
||||||
if(pairing_data_changed) set_TaskComps_timer(2,2000);
|
if(pairing_data_changed) set_TaskComps_timer(2,2000);
|
||||||
|
if(app_pairing_requested)
|
||||||
|
{
|
||||||
|
app_pairing_requested = 0U;
|
||||||
|
if(res_data==Brightness_H ||
|
||||||
|
res_data==B_Brightness_H ||
|
||||||
|
res_data==F_Brightness_10)
|
||||||
|
ble_remote_event_notify(0x0DU, 2U,
|
||||||
|
rf433_paired_count());
|
||||||
|
else
|
||||||
|
ble_remote_event_notify(0x0EU, 1U, 0U);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,8 +491,38 @@ static void set_click(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint8_t rf433_is_mode_step_command(uint8_t command)
|
||||||
|
{
|
||||||
|
return command == Mode_add || command == Mode_dow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Act immediately on the first valid mode frame. Repeated frames carrying
|
||||||
|
* the same key are accepted at most once every 500 ms. Keep this independent
|
||||||
|
* from the generic 150 ms release detector so an occasional missing RF frame
|
||||||
|
* cannot turn one physical hold into several rapid short presses.
|
||||||
|
*/
|
||||||
|
static uint8_t rf433_mode_step_ready(uint8_t command)
|
||||||
|
{
|
||||||
|
uint32_t now = rf433_sample_ticks;
|
||||||
|
|
||||||
|
if(!rf433_mode_action_valid ||
|
||||||
|
rf433_mode_last_key != command ||
|
||||||
|
(uint32_t)(now - rf433_mode_last_action_tick) >=
|
||||||
|
RF433_MODE_REPEAT_TICKS)
|
||||||
|
{
|
||||||
|
rf433_mode_last_key = command;
|
||||||
|
rf433_mode_last_action_tick = now;
|
||||||
|
rf433_mode_action_valid = 1U;
|
||||||
|
return 1U;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0U;
|
||||||
|
}
|
||||||
|
|
||||||
void rf433_receive(void)//RF433 sample, called every 100 us
|
void rf433_receive(void)//RF433 sample, called every 100 us
|
||||||
{
|
{
|
||||||
|
rf433_sample_ticks++;
|
||||||
rf433_decoder_sample((RF_DATA == HIGH_LEVEL) ? 1U : 0U);
|
rf433_decoder_sample((RF_DATA == HIGH_LEVEL) ? 1U : 0U);
|
||||||
|
|
||||||
if(long_time > 0U)
|
if(long_time > 0U)
|
||||||
@@ -452,8 +572,15 @@ void _433_fun(){
|
|||||||
pair_deferred_receive_data = receive_data;
|
pair_deferred_receive_data = receive_data;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(Key_TypeDef.KEY_STATE_Click==1||KEY_STATE_re==1) return;
|
if(rf433_is_mode_step_command(res_data))
|
||||||
set_click();
|
{
|
||||||
|
if(!rf433_mode_step_ready(res_data)) return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(Key_TypeDef.KEY_STATE_Click==1||KEY_STATE_re==1) return;
|
||||||
|
set_click();
|
||||||
|
}
|
||||||
switch(res_data){
|
switch(res_data){
|
||||||
//椭圆
|
//椭圆
|
||||||
case ON://单击
|
case ON://单击
|
||||||
@@ -564,4 +691,3 @@ void scan_433(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
#include "mode.h"
|
#include "mode.h"
|
||||||
#include "RF433.h"
|
#include "RF433.h"
|
||||||
#include "rf433_decoder.h"
|
#include "rf433_decoder.h"
|
||||||
|
#include "external_key.h"
|
||||||
#include "rgblight.h"
|
#include "rgblight.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "fmc_spi.h"
|
#include "fmc_spi.h"
|
||||||
@@ -389,7 +390,6 @@ int main(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
wdt_init();
|
|
||||||
/* Set the broadcast address of the device. */
|
/* Set the broadcast address of the device. */
|
||||||
board_init();
|
board_init();
|
||||||
xc_fmc_spi_init_oprt( );
|
xc_fmc_spi_init_oprt( );
|
||||||
@@ -397,6 +397,8 @@ int main(void)
|
|||||||
|
|
||||||
fmc_spi_read();
|
fmc_spi_read();
|
||||||
power_restore_apply_on_boot();
|
power_restore_apply_on_boot();
|
||||||
|
/* Start the watchdog after the optional boot-time Flash update. */
|
||||||
|
wdt_init();
|
||||||
timer0_2_init();
|
timer0_2_init();
|
||||||
bluetooth_init();
|
bluetooth_init();
|
||||||
|
|
||||||
@@ -450,8 +452,11 @@ int main(void)
|
|||||||
#endif
|
#endif
|
||||||
// gpio_pullup_input_inter_test();
|
// gpio_pullup_input_inter_test();
|
||||||
adc_Init();
|
adc_Init();
|
||||||
rf433_decoder_init();
|
external_key_init();
|
||||||
|
/* Keep RF433 GPIO initialization after the other input setup. */
|
||||||
rf433_gpio_init();
|
rf433_gpio_init();
|
||||||
|
/* Clear any startup transition pulses after RF433 GPIO is stable. */
|
||||||
|
rf433_decoder_init();
|
||||||
while (1){
|
while (1){
|
||||||
//DEBUG("222\r\n");
|
//DEBUG("222\r\n");
|
||||||
//printf("ddd=%d---%d---%d\r\n",W_PWM_duty,C_PWM_duty,(2*deadTime));
|
//printf("ddd=%d---%d---%d\r\n",W_PWM_duty,C_PWM_duty,(2*deadTime));
|
||||||
|
|||||||
@@ -521,15 +521,13 @@ __RAM_CODE void Bridge_Service_1ms(void)
|
|||||||
pwm_duty = (uint16_t)((total * BRIDGE_PWM_SCALE +
|
pwm_duty = (uint16_t)((total * BRIDGE_PWM_SCALE +
|
||||||
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE);
|
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE);
|
||||||
/*
|
/*
|
||||||
* A mixed H-bridge frame has 450 us of active time after deadtime.
|
* Use the same 450 us maximum energy as mixed light for every
|
||||||
* Use the same 450/500 energy at both single-color endpoints of the
|
* single-color output. Switching between the hardware-PWM and
|
||||||
* continuous gradient so its total brightness does not jump there.
|
* Timer3 mixed-light paths therefore does not change total energy.
|
||||||
*/
|
*/
|
||||||
if (Mode == mode3 && choose_mode_falsg == 7U) {
|
pwm_duty = (uint16_t)(
|
||||||
pwm_duty = (uint16_t)(
|
((uint32_t)pwm_duty * BRIDGE_DUAL_ACTIVE_US +
|
||||||
((uint32_t)pwm_duty * BRIDGE_DUAL_ACTIVE_US +
|
(BRIDGE_FRAME_US / 2U)) / BRIDGE_FRAME_US);
|
||||||
(BRIDGE_FRAME_US / 2U)) / BRIDGE_FRAME_US);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (output_mode == BRIDGE_MODE_SINGLE &&
|
if (output_mode == BRIDGE_MODE_SINGLE &&
|
||||||
active_state == single_state &&
|
active_state == single_state &&
|
||||||
@@ -556,22 +554,8 @@ __RAM_CODE void Bridge_Service_1ms(void)
|
|||||||
* split evenly between W->C and C->W, which both absorbs interrupt
|
* split evenly between W->C and C->W, which both absorbs interrupt
|
||||||
* latency and spreads the two optical pulses across the 500 us frame.
|
* latency and spreads the two optical pulses across the 500 us frame.
|
||||||
*/
|
*/
|
||||||
if (Mode == mode3 && choose_mode_falsg == 8U) {
|
total_on_us = (BRIDGE_DUAL_ACTIVE_US * total +
|
||||||
/*
|
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE;
|
||||||
* The overlap gradient intentionally carries only 40% combined
|
|
||||||
* output through its crossover. Base that section on the complete
|
|
||||||
* 500 us frame so entering/leaving dual output does not create a
|
|
||||||
* 10% brightness step. The 450 us safety ceiling still applies.
|
|
||||||
*/
|
|
||||||
total_on_us = (BRIDGE_FRAME_US * total +
|
|
||||||
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE;
|
|
||||||
if (total_on_us > BRIDGE_DUAL_ACTIVE_US) {
|
|
||||||
total_on_us = BRIDGE_DUAL_ACTIVE_US;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
total_on_us = (BRIDGE_DUAL_ACTIVE_US * total +
|
|
||||||
(BRIDGE_MIX_SCALE / 2U)) / BRIDGE_MIX_SCALE;
|
|
||||||
}
|
|
||||||
/* Keep a non-zero timer interval without imposing a brightness floor. */
|
/* Keep a non-zero timer interval without imposing a brightness floor. */
|
||||||
if (total_on_us < (2U * BRIDGE_MIN_DUAL_PULSE_US)) {
|
if (total_on_us < (2U * BRIDGE_MIN_DUAL_PULSE_US)) {
|
||||||
total_on_us = 2U * BRIDGE_MIN_DUAL_PULSE_US;
|
total_on_us = 2U * BRIDGE_MIN_DUAL_PULSE_US;
|
||||||
|
|||||||
@@ -0,0 +1,278 @@
|
|||||||
|
#include "external_key.h"
|
||||||
|
#include "xc_drv_gpio.h"
|
||||||
|
#include "Mode.h"
|
||||||
|
#include "PWM.h"
|
||||||
|
#include "RF433.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "timeslice.h"
|
||||||
|
|
||||||
|
#define EXTERNAL_KEY_PIN GPIO_5
|
||||||
|
#define EXTERNAL_KEY_PRESSED_LEVEL GPIO_PIN_RESET
|
||||||
|
|
||||||
|
/* external_key_scan is called every 10 ms. */
|
||||||
|
#define EXT_KEY_DEBOUNCE_TICKS 2U
|
||||||
|
#define EXT_KEY_DOUBLE_TICKS 15U
|
||||||
|
#define EXT_KEY_LONG_TICKS 40U
|
||||||
|
#define EXT_KEY_BRIGHTNESS_STEP_TICKS 5U
|
||||||
|
#define EXT_KEY_SPEED_STEP_TICKS 15U
|
||||||
|
#define EXT_KEY_CLEAR_CODE_TICKS 3000U
|
||||||
|
|
||||||
|
#define EXT_KEY_BRIGHTNESS_STEP 3U
|
||||||
|
#define EXT_KEY_SPEED_STEP 1U
|
||||||
|
#define EXT_KEY_SAVE_DELAY_MS 1000U
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
EXT_KEY_IDLE = 0,
|
||||||
|
EXT_KEY_DOWN,
|
||||||
|
EXT_KEY_WAIT_SECOND,
|
||||||
|
EXT_KEY_SECOND_DOWN,
|
||||||
|
EXT_KEY_LONG
|
||||||
|
} EXT_KEY_STATE;
|
||||||
|
|
||||||
|
static EXT_KEY_STATE ext_key_state = EXT_KEY_IDLE;
|
||||||
|
static uint16_t ext_key_press_ticks;
|
||||||
|
static uint16_t ext_key_wait_ticks;
|
||||||
|
static uint16_t ext_key_step_ticks;
|
||||||
|
static uint8_t ext_key_direction_up = 1U;
|
||||||
|
static uint8_t ext_key_adjust_speed;
|
||||||
|
static uint8_t ext_key_clear_triggered;
|
||||||
|
|
||||||
|
static uint8_t external_key_is_pressed(void)
|
||||||
|
{
|
||||||
|
return xc_gpio_read_pin(EXTERNAL_KEY_PIN) ==
|
||||||
|
EXTERNAL_KEY_PRESSED_LEVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_save_later(void)
|
||||||
|
{
|
||||||
|
set_TaskComps_timer(2U, EXT_KEY_SAVE_DELAY_MS);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_power_toggle(void)
|
||||||
|
{
|
||||||
|
if(deviceStatus == POWEROFF)
|
||||||
|
Start_PWM();
|
||||||
|
else
|
||||||
|
Stop_PWM();
|
||||||
|
|
||||||
|
external_key_save_later();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_mode_next(void)
|
||||||
|
{
|
||||||
|
if(deviceStatus == POWEROFF)
|
||||||
|
Start_PWM();
|
||||||
|
|
||||||
|
if(choose_mode_falsg >= EFFECT_MODE_MAX)
|
||||||
|
choose_mode_falsg = EFFECT_MODE_MIN;
|
||||||
|
else
|
||||||
|
choose_mode_falsg++;
|
||||||
|
|
||||||
|
choose_mode_bh = 0U;
|
||||||
|
startTimer(&timer1, 1U);
|
||||||
|
external_key_save_later();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_brightness_step(void)
|
||||||
|
{
|
||||||
|
if(ext_key_direction_up)
|
||||||
|
{
|
||||||
|
if(Brightness >=
|
||||||
|
(BRIGHTNESS_MAX_PERCENT - EXT_KEY_BRIGHTNESS_STEP))
|
||||||
|
Brightness = BRIGHTNESS_MAX_PERCENT;
|
||||||
|
else
|
||||||
|
Brightness += EXT_KEY_BRIGHTNESS_STEP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(Brightness <=
|
||||||
|
(BRIGHTNESS_MIN_PERCENT + EXT_KEY_BRIGHTNESS_STEP))
|
||||||
|
Brightness = BRIGHTNESS_MIN_PERCENT;
|
||||||
|
else
|
||||||
|
Brightness -= EXT_KEY_BRIGHTNESS_STEP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_speed_step(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* A smaller Speed value is faster in the current effect tables.
|
||||||
|
* Keep the same direction convention used by DWM11.
|
||||||
|
*/
|
||||||
|
if(ext_key_direction_up)
|
||||||
|
{
|
||||||
|
if(Speed > SPEED_MIN_LEVEL)
|
||||||
|
Speed -= EXT_KEY_SPEED_STEP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(Speed < SPEED_MAX_LEVEL)
|
||||||
|
Speed += EXT_KEY_SPEED_STEP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_adjust_step(void)
|
||||||
|
{
|
||||||
|
if(deviceStatus == POWEROFF)
|
||||||
|
Start_PWM();
|
||||||
|
|
||||||
|
if(ext_key_adjust_speed)
|
||||||
|
external_key_speed_step();
|
||||||
|
else
|
||||||
|
external_key_brightness_step();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_long_start(void)
|
||||||
|
{
|
||||||
|
ext_key_adjust_speed = (Mode == mode0) ? 0U : 1U;
|
||||||
|
ext_key_step_ticks = 0U;
|
||||||
|
external_key_adjust_step();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void external_key_long_stop(void)
|
||||||
|
{
|
||||||
|
if(ext_key_clear_triggered)
|
||||||
|
{
|
||||||
|
ext_key_clear_triggered = 0U;
|
||||||
|
ext_key_adjust_speed = 0U;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
external_key_save_later();
|
||||||
|
ext_key_direction_up = ext_key_direction_up ? 0U : 1U;
|
||||||
|
ext_key_adjust_speed = 0U;
|
||||||
|
}
|
||||||
|
|
||||||
|
void external_key_init(void)
|
||||||
|
{
|
||||||
|
GPIO_InitCfg_t gpio_cfg = {0};
|
||||||
|
|
||||||
|
gpio_cfg.Mux = GPIO_Mux0;
|
||||||
|
gpio_cfg.FunSel = GPIO_Dx;
|
||||||
|
gpio_cfg.Pull = GPIO_PULLUP;
|
||||||
|
gpio_cfg.Dir = GPIO_DIR_INPUT;
|
||||||
|
gpio_cfg.Int = NOT_INT;
|
||||||
|
gpio_cfg.Pin = EXTERNAL_KEY_PIN;
|
||||||
|
xc_gpio_init(&gpio_cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void external_key_scan(void)
|
||||||
|
{
|
||||||
|
uint8_t pressed = external_key_is_pressed();
|
||||||
|
uint16_t step_period;
|
||||||
|
|
||||||
|
switch(ext_key_state)
|
||||||
|
{
|
||||||
|
case EXT_KEY_IDLE:
|
||||||
|
if(pressed)
|
||||||
|
{
|
||||||
|
ext_key_press_ticks = 1U;
|
||||||
|
ext_key_step_ticks = 0U;
|
||||||
|
ext_key_clear_triggered = 0U;
|
||||||
|
ext_key_state = EXT_KEY_DOWN;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EXT_KEY_DOWN:
|
||||||
|
if(pressed)
|
||||||
|
{
|
||||||
|
if(ext_key_press_ticks < 0xFFFFU)
|
||||||
|
ext_key_press_ticks++;
|
||||||
|
|
||||||
|
if(ext_key_press_ticks >= EXT_KEY_LONG_TICKS)
|
||||||
|
{
|
||||||
|
external_key_long_start();
|
||||||
|
ext_key_state = EXT_KEY_LONG;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(ext_key_press_ticks >= EXT_KEY_DEBOUNCE_TICKS)
|
||||||
|
{
|
||||||
|
ext_key_wait_ticks = 0U;
|
||||||
|
ext_key_state = EXT_KEY_WAIT_SECOND;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ext_key_state = EXT_KEY_IDLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EXT_KEY_WAIT_SECOND:
|
||||||
|
if(pressed)
|
||||||
|
{
|
||||||
|
ext_key_press_ticks = 1U;
|
||||||
|
ext_key_step_ticks = 0U;
|
||||||
|
ext_key_clear_triggered = 0U;
|
||||||
|
ext_key_state = EXT_KEY_SECOND_DOWN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ext_key_wait_ticks++;
|
||||||
|
if(ext_key_wait_ticks >= EXT_KEY_DOUBLE_TICKS)
|
||||||
|
{
|
||||||
|
external_key_power_toggle();
|
||||||
|
ext_key_state = EXT_KEY_IDLE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EXT_KEY_SECOND_DOWN:
|
||||||
|
if(pressed)
|
||||||
|
{
|
||||||
|
if(ext_key_press_ticks < 0xFFFFU)
|
||||||
|
ext_key_press_ticks++;
|
||||||
|
|
||||||
|
if(ext_key_press_ticks >= EXT_KEY_LONG_TICKS)
|
||||||
|
{
|
||||||
|
external_key_long_start();
|
||||||
|
ext_key_state = EXT_KEY_LONG;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(ext_key_press_ticks >= EXT_KEY_DEBOUNCE_TICKS)
|
||||||
|
external_key_mode_next();
|
||||||
|
ext_key_state = EXT_KEY_IDLE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EXT_KEY_LONG:
|
||||||
|
if(pressed)
|
||||||
|
{
|
||||||
|
if(ext_key_press_ticks < 0xFFFFU)
|
||||||
|
ext_key_press_ticks++;
|
||||||
|
|
||||||
|
if(!ext_key_clear_triggered &&
|
||||||
|
ext_key_press_ticks >= EXT_KEY_CLEAR_CODE_TICKS)
|
||||||
|
{
|
||||||
|
ext_key_clear_triggered = 1U;
|
||||||
|
rf433_clear_code();
|
||||||
|
}
|
||||||
|
else if(!ext_key_clear_triggered)
|
||||||
|
{
|
||||||
|
step_period = ext_key_adjust_speed ?
|
||||||
|
EXT_KEY_SPEED_STEP_TICKS :
|
||||||
|
EXT_KEY_BRIGHTNESS_STEP_TICKS;
|
||||||
|
ext_key_step_ticks++;
|
||||||
|
if(ext_key_step_ticks >= step_period)
|
||||||
|
{
|
||||||
|
ext_key_step_ticks = 0U;
|
||||||
|
external_key_adjust_step();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
external_key_long_stop();
|
||||||
|
ext_key_state = EXT_KEY_IDLE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ext_key_state = EXT_KEY_IDLE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#ifndef _EXTERNAL_KEY_H_
|
||||||
|
#define _EXTERNAL_KEY_H_
|
||||||
|
|
||||||
|
void external_key_init(void);
|
||||||
|
void external_key_scan(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -289,14 +289,9 @@ void power_restore_apply_on_boot(void)
|
|||||||
power_cycle_next_mode = (uint8_t)((mode_index + 1U) % 3U);
|
power_cycle_next_mode = (uint8_t)((mode_index + 1U) % 3U);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Save the next startup mode before timers, BLE and the H-bridge start.
|
* Cycle-static is also a remembered state. Start PWM, BLE and the
|
||||||
* A deferred flash erase/write masks interrupts long enough to stretch
|
* H-bridge through the same path as full-memory restore, then persist
|
||||||
* one Timer3-controlled dual-color pulse and causes a visible flash.
|
* the next static mode through the normal deferred Flash state machine.
|
||||||
*/
|
*/
|
||||||
wright_user_data();
|
set_TaskComps_timer(2U, POWER_POLICY_SAVE_DELAY_MS);
|
||||||
GLOBAL_INT_DISABLE();
|
|
||||||
xc_fmc_spi_flash_erase_page(USER_DATA_FLASH_ADDR);
|
|
||||||
xc_fmc_spi_flash_write_page(USER_DATA_FLASH_ADDR,
|
|
||||||
app_data, FLASH_PAGE_SIZE);
|
|
||||||
GLOBAL_INT_RESTORE();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,11 @@ volatile uint32_t Light_Transition_C_Output_Q12;
|
|||||||
|
|
||||||
#define BRIGHTNESS_SMOOTH_SHIFT 4U
|
#define BRIGHTNESS_SMOOTH_SHIFT 4U
|
||||||
#define OUTPUT_SMOOTH_SHIFT 4U
|
#define OUTPUT_SMOOTH_SHIFT 4U
|
||||||
#define MODE_TRANSITION_TICKS 40U
|
#define MODE_TRANSITION_TICKS 100U
|
||||||
|
#define CCT_RING_TRANSITION_TICKS 40U
|
||||||
|
#define TRANSITION_CURVE_LINEAR 0U
|
||||||
|
#define TRANSITION_CURVE_GAMMA_S 1U
|
||||||
|
#define TRANSITION_CURVE_GAMMA_OUT 2U
|
||||||
#define LIGHT_OUTPUT_SCALE 1000U
|
#define LIGHT_OUTPUT_SCALE 1000U
|
||||||
#define BREATH_MIN_OUTPUT (LIGHT_OUTPUT_SCALE / 100U)
|
#define BREATH_MIN_OUTPUT (LIGHT_OUTPUT_SCALE / 100U)
|
||||||
#define DUAL_MIN_STABLE_CHANNEL_OUTPUT 102U
|
#define DUAL_MIN_STABLE_CHANNEL_OUTPUT 102U
|
||||||
@@ -78,6 +82,29 @@ static const uint16_t power_fade_gamma_q12[101] = {
|
|||||||
4096U
|
4096U
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Symmetric Gamma 1.8 transition curve:
|
||||||
|
* q = p^1.8 / (p^1.8 + (1-p)^1.8)
|
||||||
|
*
|
||||||
|
* Unlike applying Gamma independently to W and C, q and (1-q) remain
|
||||||
|
* complementary. The transition therefore eases in and out without causing
|
||||||
|
* a brightness dip in the middle. A table keeps the 5 ms task free of
|
||||||
|
* floating-point and power calculations.
|
||||||
|
*/
|
||||||
|
static const uint16_t transition_gamma_s_q12[101] = {
|
||||||
|
0U, 1U, 4U, 8U, 13U, 20U, 29U, 39U, 50U, 63U,
|
||||||
|
77U, 93U, 110U, 130U, 150U, 173U, 197U, 223U, 251U, 281U,
|
||||||
|
312U, 345U, 381U, 418U, 457U, 498U, 541U, 586U, 633U, 681U,
|
||||||
|
732U, 784U, 839U, 895U, 953U, 1012U, 1073U, 1136U, 1200U, 1265U,
|
||||||
|
1332U, 1400U, 1469U, 1539U, 1610U, 1682U, 1754U, 1827U, 1901U, 1974U,
|
||||||
|
2048U, 2122U, 2195U, 2269U, 2342U, 2414U, 2486U, 2557U, 2627U, 2696U,
|
||||||
|
2764U, 2831U, 2896U, 2960U, 3023U, 3084U, 3143U, 3201U, 3257U, 3312U,
|
||||||
|
3364U, 3415U, 3463U, 3510U, 3555U, 3598U, 3639U, 3678U, 3715U, 3751U,
|
||||||
|
3784U, 3815U, 3845U, 3873U, 3899U, 3923U, 3946U, 3966U, 3986U, 4003U,
|
||||||
|
4019U, 4033U, 4046U, 4057U, 4067U, 4076U, 4083U, 4088U, 4092U, 4095U,
|
||||||
|
4096U
|
||||||
|
};
|
||||||
|
|
||||||
static uint16_t current_brightness_q12;
|
static uint16_t current_brightness_q12;
|
||||||
static uint16_t power_fade_progress_q12;
|
static uint16_t power_fade_progress_q12;
|
||||||
static uint16_t power_fade_remainder;
|
static uint16_t power_fade_remainder;
|
||||||
@@ -86,6 +113,8 @@ static uint8_t transition_sync_pending;
|
|||||||
static uint16_t mode_transition_start_w;
|
static uint16_t mode_transition_start_w;
|
||||||
static uint16_t mode_transition_start_c;
|
static uint16_t mode_transition_start_c;
|
||||||
static uint8_t mode_transition_tick;
|
static uint8_t mode_transition_tick;
|
||||||
|
static uint8_t mode_transition_total_ticks;
|
||||||
|
static uint8_t mode_transition_gamma_curve;
|
||||||
static volatile uint8_t feedback_active;
|
static volatile uint8_t feedback_active;
|
||||||
static volatile uint8_t feedback_on;
|
static volatile uint8_t feedback_on;
|
||||||
|
|
||||||
@@ -153,24 +182,54 @@ static uint16_t approach_target(uint16_t current, uint16_t target)
|
|||||||
return current - step;
|
return current - step;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static uint16_t transition_gamma_s_scale(uint8_t tick, uint8_t total_ticks)
|
||||||
|
{
|
||||||
|
uint16_t index;
|
||||||
|
|
||||||
|
if(total_ticks == 0U || tick >= total_ticks) return 4096U;
|
||||||
|
index = (uint16_t)(((uint16_t)tick * 100U +
|
||||||
|
(total_ticks / 2U)) / total_ticks);
|
||||||
|
if(index > 100U) index = 100U;
|
||||||
|
return transition_gamma_s_q12[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint16_t transition_gamma_out_scale(uint8_t tick, uint8_t total_ticks)
|
||||||
|
{
|
||||||
|
uint16_t index;
|
||||||
|
|
||||||
|
if(total_ticks == 0U || tick >= total_ticks) return 4096U;
|
||||||
|
index = (uint16_t)(((uint16_t)tick * 100U +
|
||||||
|
(total_ticks / 2U)) / total_ticks);
|
||||||
|
if(index > 100U) index = 100U;
|
||||||
|
return (uint16_t)(4096U - power_fade_gamma_q12[100U - index]);
|
||||||
|
}
|
||||||
|
|
||||||
static uint16_t interpolate_mode_output(uint16_t start, uint16_t target,
|
static uint16_t interpolate_mode_output(uint16_t start, uint16_t target,
|
||||||
uint8_t tick)
|
uint8_t tick)
|
||||||
{
|
{
|
||||||
uint32_t delta;
|
uint32_t delta;
|
||||||
|
uint16_t progress_q12;
|
||||||
|
uint8_t total_ticks = mode_transition_total_ticks;
|
||||||
|
|
||||||
|
if(total_ticks == 0U || tick >= total_ticks) return target;
|
||||||
|
if(mode_transition_gamma_curve == TRANSITION_CURVE_GAMMA_S)
|
||||||
|
progress_q12 = transition_gamma_s_scale(tick, total_ticks);
|
||||||
|
else if(mode_transition_gamma_curve == TRANSITION_CURVE_GAMMA_OUT)
|
||||||
|
progress_q12 = transition_gamma_out_scale(tick, total_ticks);
|
||||||
|
else
|
||||||
|
progress_q12 = (uint16_t)(
|
||||||
|
((uint32_t)tick * 4096U + (total_ticks / 2U)) / total_ticks);
|
||||||
|
|
||||||
if(tick >= MODE_TRANSITION_TICKS) return target;
|
|
||||||
if(target >= start)
|
if(target >= start)
|
||||||
{
|
{
|
||||||
delta = (uint32_t)(target - start) * tick;
|
delta = (uint32_t)(target - start) * progress_q12;
|
||||||
return (uint16_t)(start +
|
return (uint16_t)(start +
|
||||||
((delta + (MODE_TRANSITION_TICKS / 2U)) /
|
((delta + 2048U) >> 12));
|
||||||
MODE_TRANSITION_TICKS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delta = (uint32_t)(start - target) * tick;
|
delta = (uint32_t)(start - target) * progress_q12;
|
||||||
return (uint16_t)(start -
|
return (uint16_t)(start -
|
||||||
((delta + (MODE_TRANSITION_TICKS / 2U)) /
|
((delta + 2048U) >> 12));
|
||||||
MODE_TRANSITION_TICKS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint16_t effect_gamma_output(uint16_t level)
|
static uint16_t effect_gamma_output(uint16_t level)
|
||||||
@@ -265,6 +324,16 @@ void Light_Transition_BeginModeChange(void)
|
|||||||
mode_transition_start_w = W_PWM_duty;
|
mode_transition_start_w = W_PWM_duty;
|
||||||
mode_transition_start_c = C_PWM_duty;
|
mode_transition_start_c = C_PWM_duty;
|
||||||
mode_transition_tick = 0U;
|
mode_transition_tick = 0U;
|
||||||
|
mode_transition_total_ticks =
|
||||||
|
(choose_mode_falsg == CUSTOM_TEMPERATURE_MODE)
|
||||||
|
? CCT_RING_TRANSITION_TICKS : MODE_TRANSITION_TICKS;
|
||||||
|
if(Mode == mode0 && choose_mode_falsg <= 2U)
|
||||||
|
mode_transition_gamma_curve = TRANSITION_CURVE_GAMMA_S;
|
||||||
|
else if(Mode == mode0 &&
|
||||||
|
choose_mode_falsg == CUSTOM_TEMPERATURE_MODE)
|
||||||
|
mode_transition_gamma_curve = TRANSITION_CURVE_GAMMA_OUT;
|
||||||
|
else
|
||||||
|
mode_transition_gamma_curve = TRANSITION_CURVE_GAMMA_S;
|
||||||
Light_Transition_ModeActive = 1U;
|
Light_Transition_ModeActive = 1U;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,6 +371,7 @@ void Light_Transition_Task(void)
|
|||||||
uint16_t weak_mix;
|
uint16_t weak_mix;
|
||||||
uint16_t required_total;
|
uint16_t required_total;
|
||||||
uint16_t floor_w;
|
uint16_t floor_w;
|
||||||
|
uint16_t color_progress_q12;
|
||||||
uint32_t scaled_w_q12;
|
uint32_t scaled_w_q12;
|
||||||
uint32_t scaled_c_q12;
|
uint32_t scaled_c_q12;
|
||||||
uint8_t power_transitioning;
|
uint8_t power_transitioning;
|
||||||
@@ -344,18 +414,28 @@ void Light_Transition_Task(void)
|
|||||||
/*
|
/*
|
||||||
* Continuous CCT uses one shared brightness envelope. Derive one
|
* Continuous CCT uses one shared brightness envelope. Derive one
|
||||||
* side from the other so every visible step is strictly complementary
|
* side from the other so every visible step is strictly complementary
|
||||||
* and W + C remains constant throughout the sweep.
|
* and W + C remains constant throughout the sweep. Map the color
|
||||||
|
* position through the same symmetric Gamma curve used by static
|
||||||
|
* transitions so the ends of each sweep are also eased.
|
||||||
*/
|
*/
|
||||||
target_total = (uint16_t)(
|
target_total = (uint16_t)(
|
||||||
((uint32_t)LIGHT_OUTPUT_SCALE * brightness_scale + 2048U) >> 12);
|
((uint32_t)LIGHT_OUTPUT_SCALE * brightness_scale + 2048U) >> 12);
|
||||||
target_w = (uint16_t)(
|
color_progress_q12 =
|
||||||
((uint32_t)target_total * W_PWM + 50U) / 100U);
|
transition_gamma_s_q12[(C_PWM <= 100U) ? C_PWM : 100U];
|
||||||
if(target_w > target_total)
|
target_c = (uint16_t)(
|
||||||
target_w = target_total;
|
((uint32_t)target_total * color_progress_q12 + 2048U) >> 12);
|
||||||
target_c = target_total - target_w;
|
if(target_c > target_total)
|
||||||
|
target_c = target_total;
|
||||||
|
target_w = target_total - target_c;
|
||||||
}
|
}
|
||||||
else if(Mode == mode1)
|
else if(Mode == mode1 ||
|
||||||
|
(Mode == mode3 && choose_mode_falsg == 8U))
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Breathing and overlap-gradient amplitudes are perceptual light
|
||||||
|
* transitions, so both use the Gamma table instead of raw linear
|
||||||
|
* channel levels. Jump/flash modes remain outside this branch.
|
||||||
|
*/
|
||||||
target_w = (uint16_t)(
|
target_w = (uint16_t)(
|
||||||
((uint32_t)effect_gamma_output(W_PWM) *
|
((uint32_t)effect_gamma_output(W_PWM) *
|
||||||
brightness_scale + 2048U) >> 12);
|
brightness_scale + 2048U) >> 12);
|
||||||
@@ -435,8 +515,10 @@ void Light_Transition_Task(void)
|
|||||||
C_PWM_duty =
|
C_PWM_duty =
|
||||||
interpolate_mode_output(mode_transition_start_c, target_c,
|
interpolate_mode_output(mode_transition_start_c, target_c,
|
||||||
mode_transition_tick);
|
mode_transition_tick);
|
||||||
if(mode_transition_tick >= MODE_TRANSITION_TICKS)
|
if(mode_transition_tick >= mode_transition_total_ticks)
|
||||||
|
{
|
||||||
Light_Transition_ModeActive = 0U;
|
Light_Transition_ModeActive = 0U;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(((Mode == mode2 || Mode == mode3) && powered_on) ||
|
else if(((Mode == mode2 || Mode == mode3) && powered_on) ||
|
||||||
power_transitioning ||
|
power_transitioning ||
|
||||||
|
|||||||
@@ -1,657 +1,179 @@
|
|||||||
#include "rf433_decoder.h"
|
#include "rf433_decoder.h"
|
||||||
#include "rf433_decoder_port.h"
|
#include "rf433_decoder_port.h"
|
||||||
|
|
||||||
#define RF433_FIFO_SIZE 256u
|
/*
|
||||||
|
* DWM11 fixed-width 24-bit RF433 decoder.
|
||||||
|
*
|
||||||
|
* The input is sampled every 100 us. A complete pulse pair is evaluated on
|
||||||
|
* each rising edge, exactly like the proven DWM11 implementation.
|
||||||
|
*/
|
||||||
|
#define RF433_SYNC_HIGH_MIN_EXCLUSIVE 1u
|
||||||
|
#define RF433_SYNC_HIGH_MAX_EXCLUSIVE 7u
|
||||||
|
#define RF433_SYNC_LOW_MIN_EXCLUSIVE 115u
|
||||||
|
#define RF433_SYNC_LOW_MAX_EXCLUSIVE 130u
|
||||||
|
|
||||||
#define RF433_SYNC_LOW_MIN 35u //45改35
|
#define RF433_ZERO_HIGH_MIN 1u
|
||||||
#define RF433_SYNC_LOW_MAX 200u //180改200
|
#define RF433_ZERO_HIGH_MAX 7u
|
||||||
#define RF433_SYNC_HIGH_MIN 1u
|
#define RF433_ZERO_LOW_MIN 7u
|
||||||
#define RF433_SYNC_HIGH_MAX 15u //12改15
|
#define RF433_ZERO_LOW_MAX 16u
|
||||||
|
|
||||||
#define RF433_BIT_LEN 24u
|
#define RF433_ONE_HIGH_MIN 7u
|
||||||
#define RF433_DIRECT_CONFIRM 1u
|
#define RF433_ONE_HIGH_MAX 16u
|
||||||
#define RF433_WEAK_CONFIRM 2u
|
#define RF433_ONE_LOW_MIN 2u
|
||||||
|
#define RF433_ONE_LOW_MAX 7u
|
||||||
|
|
||||||
#define RF433_LEVEL_TIMEOUT 300u //300
|
#define RF433_BIT_LEN 24u
|
||||||
|
|
||||||
#define RF433_BIT_TOTAL_MIN 3u //4改3
|
|
||||||
#define RF433_BIT_TOTAL_MAX 40u //35改40
|
|
||||||
|
|
||||||
#define RF433_PROCESS_MAX_ONCE 32u
|
|
||||||
|
|
||||||
#define RF433_FRAME_SCORE_DIRECT_MIN 50u
|
|
||||||
#define RF433_FRAME_SCORE_WEAK_MIN 35u
|
|
||||||
#define RF433_BIT_SCORE_GOOD 4u
|
|
||||||
#define RF433_BIT_SCORE_NORMAL 3u
|
|
||||||
#define RF433_BIT_SCORE_POOR 1u
|
|
||||||
|
|
||||||
#define RF433_WINDOW_TIGHT 0u
|
|
||||||
#define RF433_WINDOW_NORMAL 1u
|
|
||||||
#define RF433_WINDOW_LOOSE 2u
|
|
||||||
|
|
||||||
|
|
||||||
// 新增:连发屏蔽间隔(单位:100us采样tick,200=20ms内相同码只输出一次)
|
|
||||||
#define RF433_ANTI_REPEAT_TICK 200u
|
|
||||||
|
|
||||||
|
|
||||||
#if RF433_DECODER_DEBUG_DETAIL
|
|
||||||
#define RF433_DETAIL_LOG(fmt, ...) RF433_DECODER_LOG(fmt, ##__VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define RF433_DETAIL_LOG(fmt, ...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
RF433_STATE_IDLE = 0,
|
|
||||||
RF433_STATE_DATA,
|
|
||||||
} Rf433State_t;
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t level;
|
volatile uint16_t high_ticks;
|
||||||
uint16_t width;
|
volatile uint16_t low_ticks;
|
||||||
} Rf433Pulse_t;
|
volatile uint8_t current_level;
|
||||||
|
volatile uint8_t sync_found;
|
||||||
typedef struct
|
volatile uint8_t bit_count;
|
||||||
{
|
volatile uint32_t data;
|
||||||
volatile Rf433Pulse_t fifo[RF433_FIFO_SIZE];
|
volatile uint8_t frame_ready;
|
||||||
volatile uint16_t w;
|
|
||||||
volatile uint16_t r;
|
|
||||||
volatile uint16_t lost;
|
|
||||||
uint8_t last_level;
|
|
||||||
uint16_t width;
|
|
||||||
uint8_t inited;
|
|
||||||
} Rf433Fifo_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
Rf433State_t state;
|
|
||||||
uint16_t last_high;
|
|
||||||
uint16_t last_low;
|
|
||||||
uint16_t t;
|
|
||||||
uint16_t short_min;
|
|
||||||
uint16_t short_max;
|
|
||||||
uint16_t long_min;
|
|
||||||
uint16_t long_max;
|
|
||||||
uint32_t data;
|
|
||||||
uint8_t bit_cnt;
|
|
||||||
uint8_t bit_score_sum;
|
|
||||||
uint8_t frame_score;
|
|
||||||
uint8_t ppl_locked;
|
|
||||||
uint8_t window_mode;
|
|
||||||
uint32_t last_code;
|
|
||||||
uint8_t same_cnt;
|
|
||||||
Rf433DecoderFrame_t frame;
|
Rf433DecoderFrame_t frame;
|
||||||
bool frame_ready;
|
} Rf433Dwm11Decoder_t;
|
||||||
|
|
||||||
|
static Rf433Dwm11Decoder_t s_dec;
|
||||||
|
|
||||||
} Rf433Decode_t;
|
static void rf433_increment_saturated(volatile uint16_t *value)
|
||||||
|
|
||||||
static Rf433Fifo_t s_fifo;
|
|
||||||
static Rf433Decode_t s_dec;
|
|
||||||
|
|
||||||
static uint16_t rf433_limit_t(uint16_t t)
|
|
||||||
{
|
{
|
||||||
if (t < 2u)
|
if (*value < 0xffffu)
|
||||||
{
|
{
|
||||||
t = 2u;
|
(*value)++;
|
||||||
}
|
|
||||||
|
|
||||||
if (t > 12u)
|
|
||||||
{
|
|
||||||
t = 12u;
|
|
||||||
}
|
|
||||||
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rf433_update_range_by_t(uint16_t t)
|
|
||||||
{
|
|
||||||
t = rf433_limit_t(t);
|
|
||||||
s_dec.t = t;
|
|
||||||
|
|
||||||
if (s_dec.window_mode == RF433_WINDOW_TIGHT)
|
|
||||||
{
|
|
||||||
s_dec.short_min = 1u;
|
|
||||||
s_dec.short_max = (uint16_t)(t + t / 2u + 2u);
|
|
||||||
s_dec.long_min = (uint16_t)(t * 2u);
|
|
||||||
s_dec.long_max = (uint16_t)(t * 4u + 2u);
|
|
||||||
}
|
|
||||||
else if (s_dec.window_mode == RF433_WINDOW_LOOSE)
|
|
||||||
{
|
|
||||||
s_dec.short_min = 1u;
|
|
||||||
s_dec.short_max = (uint16_t)(t * 2u + 4u);
|
|
||||||
s_dec.long_min = (uint16_t)(t + t / 2u);
|
|
||||||
if (s_dec.long_min < 3u)
|
|
||||||
{
|
|
||||||
s_dec.long_min = 3u;
|
|
||||||
}
|
|
||||||
s_dec.long_max = (uint16_t)(t * 7u + 4u);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s_dec.short_min = 1u;
|
|
||||||
s_dec.short_max = (uint16_t)(t * 2u + 3u);
|
|
||||||
s_dec.long_min = (uint16_t)(t + t / 2u);
|
|
||||||
if (s_dec.long_min < 3u)
|
|
||||||
{
|
|
||||||
s_dec.long_min = 3u;
|
|
||||||
}
|
|
||||||
s_dec.long_max = (uint16_t)(t * 7u + 3u);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rf433_decode_reset(void)
|
static uint8_t rf433_in_range(uint16_t value, uint16_t min, uint16_t max)
|
||||||
{
|
{
|
||||||
s_dec.state = RF433_STATE_IDLE;
|
return (value >= min && value <= max) ? 1u : 0u;
|
||||||
s_dec.last_high = 0;
|
|
||||||
s_dec.last_low = 0;
|
|
||||||
s_dec.data = 0;
|
|
||||||
s_dec.bit_cnt = 0;
|
|
||||||
s_dec.bit_score_sum = 0;
|
|
||||||
s_dec.frame_score = 0;
|
|
||||||
s_dec.window_mode = RF433_WINDOW_NORMAL;
|
|
||||||
rf433_update_range_by_t(4u);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rf433_debug_reset(const char *reason, uint16_t high, uint16_t low)
|
static uint8_t rf433_is_sync(uint16_t high, uint16_t low)
|
||||||
{
|
{
|
||||||
RF433_DETAIL_LOG("[RF433 RESET] %s bits=%d high=%d low=%d data=0x%06X T=%d win=%d lost=%d\r\n",
|
return (high > RF433_SYNC_HIGH_MIN_EXCLUSIVE &&
|
||||||
reason,
|
high < RF433_SYNC_HIGH_MAX_EXCLUSIVE &&
|
||||||
s_dec.bit_cnt,
|
low > RF433_SYNC_LOW_MIN_EXCLUSIVE &&
|
||||||
high,
|
low < RF433_SYNC_LOW_MAX_EXCLUSIVE) ? 1u : 0u;
|
||||||
low,
|
}
|
||||||
(unsigned int)s_dec.data,
|
|
||||||
s_dec.t,
|
static void rf433_publish_frame(uint32_t code)
|
||||||
s_dec.window_mode,
|
{
|
||||||
s_fifo.lost);
|
s_dec.frame.code = code;
|
||||||
|
s_dec.frame.bit_len = RF433_BIT_LEN;
|
||||||
|
s_dec.frame.addr_h = (uint8_t)((code >> 16) & 0xffu);
|
||||||
|
s_dec.frame.addr_l = (uint8_t)((code >> 8) & 0xffu);
|
||||||
|
s_dec.frame.key = (uint8_t)(code & 0xffu);
|
||||||
|
s_dec.frame.score = 100u;
|
||||||
|
s_dec.frame_ready = 1u;
|
||||||
|
|
||||||
|
RF433_DECODER_LOG("[RF433 DWM11 OK] code=0x%06X key=0x%02X\r\n",
|
||||||
|
(unsigned int)code,
|
||||||
|
s_dec.frame.key);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rf433_decode_bit(uint8_t bit)
|
||||||
|
{
|
||||||
|
s_dec.data <<= 1;
|
||||||
|
if (bit != 0u)
|
||||||
|
{
|
||||||
|
s_dec.data |= 1u;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_dec.bit_count++;
|
||||||
|
if (s_dec.bit_count >= RF433_BIT_LEN)
|
||||||
|
{
|
||||||
|
rf433_publish_frame(s_dec.data);
|
||||||
|
s_dec.sync_found = 0u;
|
||||||
|
s_dec.bit_count = 0u;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rf433_decoder_init(void)
|
void rf433_decoder_init(void)
|
||||||
{
|
{
|
||||||
s_fifo.w = 0;
|
s_dec.high_ticks = 0u;
|
||||||
s_fifo.r = 0;
|
s_dec.low_ticks = 0u;
|
||||||
s_fifo.lost = 0;
|
s_dec.current_level = 0u;
|
||||||
s_fifo.last_level = 0;
|
s_dec.sync_found = 0u;
|
||||||
s_fifo.width = 0;
|
s_dec.bit_count = 0u;
|
||||||
s_fifo.inited = 0;
|
s_dec.data = 0u;
|
||||||
|
s_dec.frame_ready = 0u;
|
||||||
s_dec.last_code = 0;
|
|
||||||
s_dec.same_cnt = 0;
|
|
||||||
s_dec.frame_ready = false;
|
|
||||||
s_dec.ppl_locked = 0;
|
|
||||||
s_dec.window_mode = RF433_WINDOW_NORMAL;
|
|
||||||
|
|
||||||
|
|
||||||
rf433_decode_reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rf433_decoder_sample(uint8_t level)
|
void rf433_decoder_sample(uint8_t level)
|
||||||
{
|
{
|
||||||
uint16_t next;
|
uint16_t high;
|
||||||
Rf433Pulse_t pulse;
|
uint16_t low;
|
||||||
|
|
||||||
level = level ? 1u : 0u;
|
level = level ? 1u : 0u;
|
||||||
|
|
||||||
if (!s_fifo.inited)
|
if (level == 0u)
|
||||||
{
|
{
|
||||||
s_fifo.last_level = level;
|
rf433_increment_saturated(&s_dec.low_ticks);
|
||||||
s_fifo.width = 1;
|
s_dec.current_level = 0u;
|
||||||
s_fifo.inited = 1;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level == s_fifo.last_level)
|
rf433_increment_saturated(&s_dec.high_ticks);
|
||||||
|
|
||||||
|
if (s_dec.current_level == 0u)
|
||||||
{
|
{
|
||||||
if (s_fifo.width < 0xFFFFu)
|
high = s_dec.high_ticks;
|
||||||
|
low = s_dec.low_ticks;
|
||||||
|
|
||||||
|
if (rf433_is_sync(high, low))
|
||||||
{
|
{
|
||||||
s_fifo.width++;
|
s_dec.sync_found = 1u;
|
||||||
|
s_dec.bit_count = 0u;
|
||||||
|
s_dec.data = 0u;
|
||||||
}
|
}
|
||||||
return;
|
else if (s_dec.sync_found != 0u)
|
||||||
}
|
|
||||||
|
|
||||||
pulse.level = s_fifo.last_level;
|
|
||||||
pulse.width = s_fifo.width;
|
|
||||||
s_fifo.last_level = level;
|
|
||||||
s_fifo.width = 1;
|
|
||||||
|
|
||||||
next = (uint16_t)((s_fifo.w + 1u) % RF433_FIFO_SIZE);
|
|
||||||
if (next != s_fifo.r)
|
|
||||||
{
|
|
||||||
s_fifo.fifo[s_fifo.w] = pulse;
|
|
||||||
s_fifo.w = next;
|
|
||||||
}
|
|
||||||
else if (s_fifo.lost < 0xFFFFu)
|
|
||||||
{
|
|
||||||
s_fifo.lost++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool rf433_fifo_pop(Rf433Pulse_t *pulse)
|
|
||||||
{
|
|
||||||
if (pulse == 0 || s_fifo.r == s_fifo.w)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
*pulse = s_fifo.fifo[s_fifo.r];
|
|
||||||
s_fifo.r = (uint16_t)((s_fifo.r + 1u) % RF433_FIFO_SIZE);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool rf433_is_sync(uint16_t high, uint16_t low)
|
|
||||||
{
|
|
||||||
if (high == 0u || low == 0u)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (high < RF433_SYNC_HIGH_MIN || high > RF433_SYNC_HIGH_MAX)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (low < RF433_SYNC_LOW_MIN || low > RF433_SYNC_LOW_MAX)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (low < (uint16_t)(high * 10u)) //12
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rf433_ppl_update_by_sync(uint16_t sync_low)
|
|
||||||
{
|
|
||||||
uint16_t t_new = rf433_limit_t((uint16_t)(sync_low / 31u));
|
|
||||||
uint16_t t_filter;
|
|
||||||
|
|
||||||
if (s_dec.ppl_locked)
|
|
||||||
{
|
|
||||||
t_filter = (uint16_t)((s_dec.t * 7u + t_new) / 8u);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
t_filter = (uint16_t)((s_dec.t * 3u + t_new) / 4u);
|
|
||||||
}
|
|
||||||
|
|
||||||
rf433_update_range_by_t(t_filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rf433_update_t_by_bit(uint16_t high, uint16_t low, uint8_t bit)
|
|
||||||
{
|
|
||||||
uint16_t t_new;
|
|
||||||
uint16_t t_filter;
|
|
||||||
|
|
||||||
if (bit == 0u)
|
|
||||||
{
|
|
||||||
t_new = (uint16_t)((high + low / 3u) / 2u);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
t_new = (uint16_t)((high / 3u + low) / 2u);
|
|
||||||
}
|
|
||||||
|
|
||||||
t_new = rf433_limit_t(t_new);
|
|
||||||
|
|
||||||
if (s_dec.ppl_locked)
|
|
||||||
{
|
|
||||||
t_filter = (uint16_t)((s_dec.t * 7u + t_new) / 8u);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
t_filter = (uint16_t)((s_dec.t * 3u + t_new) / 4u);
|
|
||||||
}
|
|
||||||
|
|
||||||
rf433_update_range_by_t(t_filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool rf433_is_short(uint16_t width)
|
|
||||||
{
|
|
||||||
return ((width >= s_dec.short_min) && (width <= s_dec.short_max));
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool rf433_is_long(uint16_t width)
|
|
||||||
{
|
|
||||||
return ((width >= s_dec.long_min) && (width <= s_dec.long_max));
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool rf433_total_valid(uint16_t high, uint16_t low)
|
|
||||||
{
|
|
||||||
uint16_t total = (uint16_t)(high + low);
|
|
||||||
return ((total >= RF433_BIT_TOTAL_MIN) && (total <= RF433_BIT_TOTAL_MAX));
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool rf433_decode_bit(uint16_t high, uint16_t low, uint8_t *bit)
|
|
||||||
{
|
|
||||||
if (bit == 0 || !rf433_total_valid(high, low))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rf433_is_short(high) && rf433_is_long(low))
|
|
||||||
{
|
|
||||||
*bit = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rf433_is_long(high) && rf433_is_short(low))
|
|
||||||
{
|
|
||||||
*bit = 1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if RF433_DECODER_DEBUG_DETAIL
|
|
||||||
static const char *rf433_bit_fail_reason(uint16_t high, uint16_t low)
|
|
||||||
{
|
|
||||||
if (!rf433_total_valid(high, low))
|
|
||||||
{
|
|
||||||
return "total";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!rf433_is_short(high) && !rf433_is_long(high))
|
|
||||||
{
|
|
||||||
return "high";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!rf433_is_short(low) && !rf433_is_long(low))
|
|
||||||
{
|
|
||||||
return "low";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "pair";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static uint16_t rf433_abs_diff_u16(uint16_t a, uint16_t b)
|
|
||||||
{
|
|
||||||
return (a > b) ? (uint16_t)(a - b) : (uint16_t)(b - a);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint8_t rf433_score_bit(uint16_t high, uint16_t low, uint8_t bit)
|
|
||||||
{
|
|
||||||
uint16_t ideal_high;
|
|
||||||
uint16_t ideal_low;
|
|
||||||
uint16_t err;
|
|
||||||
|
|
||||||
if (bit == 0u)
|
|
||||||
{
|
|
||||||
ideal_high = s_dec.t;
|
|
||||||
ideal_low = (uint16_t)(s_dec.t * 3u);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ideal_high = (uint16_t)(s_dec.t * 3u);
|
|
||||||
ideal_low = s_dec.t;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = (uint16_t)(rf433_abs_diff_u16(high, ideal_high) +
|
|
||||||
rf433_abs_diff_u16(low, ideal_low));
|
|
||||||
|
|
||||||
if (err <= 2u)
|
|
||||||
{
|
|
||||||
return RF433_BIT_SCORE_GOOD;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err <= 5u)
|
|
||||||
{
|
|
||||||
return RF433_BIT_SCORE_NORMAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return RF433_BIT_SCORE_POOR;
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint8_t rf433_calc_frame_score(void)
|
|
||||||
{
|
|
||||||
uint16_t score;
|
|
||||||
|
|
||||||
if (s_dec.bit_cnt == 0u)
|
|
||||||
{
|
|
||||||
return 0u;
|
|
||||||
}
|
|
||||||
|
|
||||||
score = (uint16_t)s_dec.bit_score_sum * 100u;
|
|
||||||
score = score / (uint16_t)(RF433_BIT_LEN * RF433_BIT_SCORE_GOOD);
|
|
||||||
return (score > 100u) ? 100u : (uint8_t)score;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rf433_update_window_by_score(uint8_t score)
|
|
||||||
{
|
|
||||||
if (score >= 90u)
|
|
||||||
{
|
|
||||||
s_dec.window_mode = RF433_WINDOW_TIGHT;
|
|
||||||
s_dec.ppl_locked = 1u;
|
|
||||||
}
|
|
||||||
else if (score >= 60u)
|
|
||||||
{
|
|
||||||
s_dec.window_mode = RF433_WINDOW_NORMAL;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s_dec.window_mode = RF433_WINDOW_LOOSE;
|
|
||||||
s_dec.ppl_locked = 0u;
|
|
||||||
}
|
|
||||||
|
|
||||||
rf433_update_range_by_t(s_dec.t);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rf433_output_code(uint32_t code, uint8_t required_count)
|
|
||||||
{
|
|
||||||
if (code == s_dec.last_code)
|
|
||||||
{
|
|
||||||
if (s_dec.same_cnt < 255u)
|
|
||||||
{
|
{
|
||||||
s_dec.same_cnt++;
|
if (rf433_in_range(high, RF433_ZERO_HIGH_MIN, RF433_ZERO_HIGH_MAX) &&
|
||||||
}
|
rf433_in_range(low, RF433_ZERO_LOW_MIN, RF433_ZERO_LOW_MAX))
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s_dec.last_code = code;
|
|
||||||
s_dec.same_cnt = 1;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
RF433_DETAIL_LOG("[RF433 REPEAT] code=0x%06X same=%d/%d\r\n",
|
|
||||||
(unsigned int)code,
|
|
||||||
s_dec.same_cnt,
|
|
||||||
required_count);
|
|
||||||
|
|
||||||
if (s_dec.same_cnt >= required_count)
|
|
||||||
{
|
|
||||||
s_dec.frame.code = code;
|
|
||||||
s_dec.frame.bit_len = RF433_BIT_LEN;
|
|
||||||
s_dec.frame.addr_h = (uint8_t)((code >> 16) & 0xFFu);
|
|
||||||
s_dec.frame.addr_l = (uint8_t)((code >> 8) & 0xFFu);
|
|
||||||
s_dec.frame.key = (uint8_t)(code & 0xFFu);
|
|
||||||
s_dec.frame.score = s_dec.frame_score;
|
|
||||||
s_dec.frame_ready = true;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
s_dec.same_cnt = 0;
|
|
||||||
|
|
||||||
RF433_DECODER_LOG("[RF433 OK] code=0x%06X addr_h=0x%02X addr_l=0x%02X key=0x%02X score=%d\r\n",
|
|
||||||
(unsigned int)s_dec.frame.code,
|
|
||||||
s_dec.frame.addr_h,
|
|
||||||
s_dec.frame.addr_l,
|
|
||||||
s_dec.frame.key,
|
|
||||||
s_dec.frame.score);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void rf433_process_clean_pulse(Rf433Pulse_t pulse)
|
|
||||||
{
|
|
||||||
uint8_t bit;
|
|
||||||
uint8_t bit_score;
|
|
||||||
|
|
||||||
if (pulse.width == 0u)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pulse.width > RF433_LEVEL_TIMEOUT)
|
|
||||||
{
|
|
||||||
rf433_debug_reset("timeout", s_dec.last_high, pulse.width);
|
|
||||||
rf433_decode_reset();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pulse.level)
|
|
||||||
{
|
|
||||||
s_dec.last_high = pulse.width;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
s_dec.last_low = pulse.width;
|
|
||||||
|
|
||||||
if (rf433_is_sync(s_dec.last_high, s_dec.last_low))
|
|
||||||
{
|
|
||||||
s_dec.window_mode = s_dec.ppl_locked ? RF433_WINDOW_TIGHT : RF433_WINDOW_NORMAL;
|
|
||||||
rf433_ppl_update_by_sync(s_dec.last_low);
|
|
||||||
|
|
||||||
RF433_DETAIL_LOG("[RF433 SYNC] high=%d low=%d T=%d short=%d-%d long=%d-%d win=%d lock=%d\r\n",
|
|
||||||
s_dec.last_high,
|
|
||||||
s_dec.last_low,
|
|
||||||
s_dec.t,
|
|
||||||
s_dec.short_min,
|
|
||||||
s_dec.short_max,
|
|
||||||
s_dec.long_min,
|
|
||||||
s_dec.long_max,
|
|
||||||
s_dec.window_mode,
|
|
||||||
s_dec.ppl_locked);
|
|
||||||
|
|
||||||
s_dec.state = RF433_STATE_DATA;
|
|
||||||
s_dec.data = 0;
|
|
||||||
s_dec.bit_cnt = 0;
|
|
||||||
s_dec.bit_score_sum = 0;
|
|
||||||
s_dec.frame_score = 0;
|
|
||||||
s_dec.last_high = 0;
|
|
||||||
s_dec.last_low = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s_dec.state != RF433_STATE_DATA ||
|
|
||||||
s_dec.last_high == 0u ||
|
|
||||||
s_dec.last_low == 0u)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rf433_decode_bit(s_dec.last_high, s_dec.last_low, &bit))
|
|
||||||
{
|
|
||||||
bit_score = rf433_score_bit(s_dec.last_high, s_dec.last_low, bit);
|
|
||||||
if (s_dec.bit_score_sum <= (uint8_t)(255u - bit_score))
|
|
||||||
{
|
|
||||||
s_dec.bit_score_sum += bit_score;
|
|
||||||
}
|
|
||||||
|
|
||||||
rf433_update_t_by_bit(s_dec.last_high, s_dec.last_low, bit);
|
|
||||||
s_dec.data <<= 1;
|
|
||||||
if (bit)
|
|
||||||
{
|
|
||||||
s_dec.data |= 1u;
|
|
||||||
}
|
|
||||||
s_dec.bit_cnt++;
|
|
||||||
|
|
||||||
RF433_DETAIL_LOG("[RF433 BIT] idx=%02d bit=%d high=%d low=%d score=%d T=%d data=0x%06X\r\n",
|
|
||||||
s_dec.bit_cnt,
|
|
||||||
bit,
|
|
||||||
s_dec.last_high,
|
|
||||||
s_dec.last_low,
|
|
||||||
bit_score,
|
|
||||||
s_dec.t,
|
|
||||||
(unsigned int)s_dec.data);
|
|
||||||
|
|
||||||
if (s_dec.bit_cnt >= RF433_BIT_LEN)
|
|
||||||
{
|
|
||||||
s_dec.frame_score = rf433_calc_frame_score();
|
|
||||||
rf433_update_window_by_score(s_dec.frame_score);
|
|
||||||
|
|
||||||
RF433_DECODER_LOG("[RF433 FRAME] score=%3d T=%2d win=%d lock=%d bits=%2d code=0x%06X addr_h=0x%02X addr_l=0x%02X key=0x%02X\r\n",
|
|
||||||
s_dec.frame_score,
|
|
||||||
s_dec.t,
|
|
||||||
s_dec.window_mode,
|
|
||||||
s_dec.ppl_locked,
|
|
||||||
s_dec.bit_cnt,
|
|
||||||
(unsigned int)s_dec.data,
|
|
||||||
(unsigned int)((s_dec.data >> 16) & 0xFFu),
|
|
||||||
(unsigned int)((s_dec.data >> 8) & 0xFFu),
|
|
||||||
(unsigned int)(s_dec.data & 0xFFu));
|
|
||||||
|
|
||||||
if (s_dec.frame_score >= RF433_FRAME_SCORE_DIRECT_MIN)
|
|
||||||
{
|
{
|
||||||
rf433_output_code(s_dec.data, RF433_DIRECT_CONFIRM);
|
rf433_decode_bit(0u);
|
||||||
}
|
}
|
||||||
else if (s_dec.frame_score >= RF433_FRAME_SCORE_WEAK_MIN)
|
else if (rf433_in_range(high, RF433_ONE_HIGH_MIN, RF433_ONE_HIGH_MAX) &&
|
||||||
|
rf433_in_range(low, RF433_ONE_LOW_MIN, RF433_ONE_LOW_MAX))
|
||||||
{
|
{
|
||||||
rf433_output_code(s_dec.data, RF433_WEAK_CONFIRM);
|
rf433_decode_bit(1u);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RF433_DECODER_LOG("[RF433 BAD] score=%d code=0x%06X\r\n",
|
s_dec.sync_found = 0u;
|
||||||
s_dec.frame_score,
|
s_dec.bit_count = 0u;
|
||||||
(unsigned int)s_dec.data);
|
s_dec.data = 0u;
|
||||||
}
|
}
|
||||||
|
|
||||||
rf433_decode_reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s_dec.low_ticks = 0u;
|
||||||
|
s_dec.high_ticks = 1u;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
s_dec.current_level = 1u;
|
||||||
#if RF433_DECODER_DEBUG_DETAIL
|
|
||||||
RF433_DETAIL_LOG("[RF433 BIT_ERR] reason=%s idx=%02d high=%d low=%d total=%d T=%d short=%d-%d long=%d-%d data=0x%06X\r\n",
|
|
||||||
rf433_bit_fail_reason(s_dec.last_high, s_dec.last_low),
|
|
||||||
(uint8_t)(s_dec.bit_cnt + 1u),
|
|
||||||
s_dec.last_high,
|
|
||||||
s_dec.last_low,
|
|
||||||
(uint16_t)(s_dec.last_high + s_dec.last_low),
|
|
||||||
s_dec.t,
|
|
||||||
s_dec.short_min,
|
|
||||||
s_dec.short_max,
|
|
||||||
s_dec.long_min,
|
|
||||||
s_dec.long_max,
|
|
||||||
(unsigned int)s_dec.data);
|
|
||||||
#endif
|
|
||||||
rf433_debug_reset("bit", s_dec.last_high, s_dec.last_low);
|
|
||||||
rf433_decode_reset();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rf433_decoder_process(void)
|
void rf433_decoder_process(void)
|
||||||
{
|
{
|
||||||
Rf433Pulse_t pulse;
|
/* DWM11 decodes directly in the 100 us sampling callback. */
|
||||||
uint8_t cnt = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while ((cnt < RF433_PROCESS_MAX_ONCE) && rf433_fifo_pop(&pulse))
|
|
||||||
{
|
|
||||||
rf433_process_clean_pulse(pulse);
|
|
||||||
cnt++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rf433_decoder_get_frame(Rf433DecoderFrame_t *frame)
|
bool rf433_decoder_get_frame(Rf433DecoderFrame_t *frame)
|
||||||
{
|
{
|
||||||
if (frame == 0 || !s_dec.frame_ready)
|
if (frame == 0 || s_dec.frame_ready == 0u)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
*frame = s_dec.frame;
|
*frame = s_dec.frame;
|
||||||
s_dec.frame_ready = false;
|
s_dec.frame_ready = 0u;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t rf433_decoder_get_lost_count(void)
|
uint16_t rf433_decoder_get_lost_count(void)
|
||||||
{
|
{
|
||||||
return s_fifo.lost;
|
return 0u;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "pwm.h"
|
#include "pwm.h"
|
||||||
#include "light_transition.h"
|
#include "light_transition.h"
|
||||||
#include "usr_server.h"
|
#include "usr_server.h"
|
||||||
|
#include "external_key.h"
|
||||||
/*********************************************************************************************************************/
|
/*********************************************************************************************************************/
|
||||||
|
|
||||||
void rwip_schedule(void);
|
void rwip_schedule(void);
|
||||||
@@ -33,6 +34,7 @@ TASK_COMPONENTS TaskComps[] =
|
|||||||
{0, 311, 1, app_op_flash}, //用户数据持久化 fmc_spi_read9
|
{0, 311, 1, app_op_flash}, //用户数据持久化 fmc_spi_read9
|
||||||
{0, 311, 1, xc_ota_schedule}, //保存flash数据任务 8 //最后调用的
|
{0, 311, 1, xc_ota_schedule}, //保存flash数据任务 8 //最后调用的
|
||||||
{0, 1, 1, rf433_decoder_process},
|
{0, 1, 1, rf433_decoder_process},
|
||||||
|
{0, 10, 10, external_key_scan}, //GPIO5 external key scan
|
||||||
};
|
};
|
||||||
|
|
||||||
/**************************************************************************************
|
/**************************************************************************************
|
||||||
|
|||||||
@@ -174,6 +174,17 @@ void scan_uart(uint8_t *arr)
|
|||||||
case 12:
|
case 12:
|
||||||
power_restore_policy_set(user_rx_buf[1]);
|
power_restore_policy_set(user_rx_buf[1]);
|
||||||
break;
|
break;
|
||||||
|
case 13:
|
||||||
|
if(user_rx_buf[1] == 0x01U)
|
||||||
|
rf433_start_pairing();
|
||||||
|
else
|
||||||
|
rf433_cancel_pairing();
|
||||||
|
break;
|
||||||
|
case 14:
|
||||||
|
/* A5 guard prevents accidental clear. */
|
||||||
|
if(user_rx_buf[1] == 0xA5U)
|
||||||
|
rf433_clear_code();
|
||||||
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ static uint8_t ble_last_brightness;
|
|||||||
static uint8_t ble_last_speed;
|
static uint8_t ble_last_speed;
|
||||||
static uint8_t ble_last_temperature;
|
static uint8_t ble_last_temperature;
|
||||||
static uint8_t ble_last_power_mode;
|
static uint8_t ble_last_power_mode;
|
||||||
|
static volatile uint8_t ble_remote_event_pending;
|
||||||
|
static volatile uint8_t ble_remote_event_command;
|
||||||
|
static volatile uint8_t ble_remote_event_status;
|
||||||
|
static volatile uint8_t ble_remote_event_paired_count;
|
||||||
|
|
||||||
static uint8_t ble_temperature_value(void)
|
static uint8_t ble_temperature_value(void)
|
||||||
{
|
{
|
||||||
@@ -112,10 +116,22 @@ static uint8_t ble_temperature_value(void)
|
|||||||
void ble_state_disconnect(void)
|
void ble_state_disconnect(void)
|
||||||
{
|
{
|
||||||
custom_svc_tx_char_notify = DISABLE;
|
custom_svc_tx_char_notify = DISABLE;
|
||||||
|
ble_remote_event_pending = 0U;
|
||||||
send_flag = 1U;
|
send_flag = 1U;
|
||||||
ble_state_dirty = BLE_STATE_DIRTY_ALL;
|
ble_state_dirty = BLE_STATE_DIRTY_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ble_remote_event_notify(uint8_t command, uint8_t status,
|
||||||
|
uint8_t paired_count)
|
||||||
|
{
|
||||||
|
if(!custom_svc_tx_char_notify) return;
|
||||||
|
|
||||||
|
ble_remote_event_command = command;
|
||||||
|
ble_remote_event_status = status;
|
||||||
|
ble_remote_event_paired_count = paired_count;
|
||||||
|
ble_remote_event_pending = 1U;
|
||||||
|
}
|
||||||
|
|
||||||
void ble_state_sync_poll(void)
|
void ble_state_sync_poll(void)
|
||||||
{
|
{
|
||||||
uint8_t data[4] = {0U, 0U, 0U, 0U};
|
uint8_t data[4] = {0U, 0U, 0U, 0U};
|
||||||
@@ -138,7 +154,24 @@ void ble_state_sync_poll(void)
|
|||||||
if(power_restore_policy != ble_last_power_mode)
|
if(power_restore_policy != ble_last_power_mode)
|
||||||
ble_state_dirty |= BLE_STATE_DIRTY_POWER_MODE;
|
ble_state_dirty |= BLE_STATE_DIRTY_POWER_MODE;
|
||||||
|
|
||||||
if(!send_flag || !ble_state_dirty) return;
|
if(!send_flag) return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Remote pairing/clear acknowledgements have priority over periodic
|
||||||
|
* state synchronization so the APP receives operation results promptly.
|
||||||
|
*/
|
||||||
|
if(ble_remote_event_pending)
|
||||||
|
{
|
||||||
|
data[0] = ble_remote_event_status;
|
||||||
|
data[1] = ble_remote_event_paired_count;
|
||||||
|
data[3] = ble_remote_event_command;
|
||||||
|
if(slave_send_data(data, sizeof(data),
|
||||||
|
CUSTOM_SVC_TX_CHAR_VAL) == GATT_NO_ERROR)
|
||||||
|
ble_remote_event_pending = 0U;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ble_state_dirty) return;
|
||||||
|
|
||||||
if(ble_state_dirty & BLE_STATE_DIRTY_POWER)
|
if(ble_state_dirty & BLE_STATE_DIRTY_POWER)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,4 +49,6 @@ uint8_t custom_svc_add(void);
|
|||||||
uint8_t slave_send_data(uint8_t *data, uint8_t len, uint8_t att_idx);
|
uint8_t slave_send_data(uint8_t *data, uint8_t len, uint8_t att_idx);
|
||||||
void ble_state_sync_poll(void);
|
void ble_state_sync_poll(void);
|
||||||
void ble_state_disconnect(void);
|
void ble_state_disconnect(void);
|
||||||
|
void ble_remote_event_notify(uint8_t command, uint8_t status,
|
||||||
|
uint8_t paired_count);
|
||||||
#endif // _USR_SERVER_H_
|
#endif // _USR_SERVER_H_
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -22,44 +22,324 @@ Dialog DLL: TARMCM1.DLL V1.14.6.0
|
|||||||
|
|
||||||
<h2>Project:</h2>
|
<h2>Project:</h2>
|
||||||
D:\workplace\工作文件\程序\新向远XC6517蓝牙芯片\PWM32EPRO\project\example\ble\ble_peripheral\mdk\ble_peripheral.uvprojx
|
D:\workplace\工作文件\程序\新向远XC6517蓝牙芯片\PWM32EPRO\project\example\ble\ble_peripheral\mdk\ble_peripheral.uvprojx
|
||||||
Project File Date: 07/26/2026
|
Project File Date: 07/29/2026
|
||||||
|
|
||||||
<h2>Output:</h2>
|
<h2>Output:</h2>
|
||||||
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Program Files\Keil_v5\ARM\ARMCC\Bin'
|
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Program Files\Keil_v5\ARM\ARMCC\Bin'
|
||||||
Build target 'ble-sdk-xip_scan'
|
Build target 'ble-sdk-xip_scan'
|
||||||
Note: source file '..\app\src\uart.c' - object file renamed from '.\Objects\uart.o' to '.\Objects\uart_1.o'.
|
Note: source file '..\app\src\uart.c' - object file renamed from '.\Objects\uart.o' to '.\Objects\uart_1.o'.
|
||||||
compiling light_transition.c...
|
compiling external_key.c...
|
||||||
..\app\src\pwm.h(134): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
..\app\src\Mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
void _PWM_INIT();
|
|
||||||
..\app\src\pwm.h(140): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
|
||||||
void adc_Init();
|
|
||||||
..\app\src\pwm.h(141): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
|
||||||
void My_ADC_Get_Value();
|
|
||||||
..\app\src\pwm.h(142): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
|
||||||
void gpio_pullup_input_inter_test();
|
|
||||||
..\app\src\mode.h(39): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
|
||||||
void choice_mode();
|
void choice_mode();
|
||||||
..\app\src\mode.h(40): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
..\app\src\Mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
void set_mode();
|
void set_mode();
|
||||||
..\app\src\mode.h(41): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
..\app\src\Mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
void Start_PWM();
|
void Start_PWM();
|
||||||
..\app\src\mode.h(42): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
..\app\src\Mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
void Stop_PWM();
|
void Stop_PWM();
|
||||||
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
..\app\src\Mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
void Set_timing();
|
void Set_timing();
|
||||||
..\app\src\light_transition.c: 9 warnings, 0 errors
|
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\external_key.c: 15 warnings, 0 errors
|
||||||
|
compiling timer.c...
|
||||||
|
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
|
void choice_mode();
|
||||||
|
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
|
void set_mode();
|
||||||
|
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
|
void Start_PWM();
|
||||||
|
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
|
void Stop_PWM();
|
||||||
|
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
|
void Set_timing();
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\timer.c: 15 warnings, 0 errors
|
||||||
|
compiling fmc_spi.c...
|
||||||
|
..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi.h(230): warning: #47-D: incompatible redefinition of macro "CUR_PAGE_NUM" (declared at line 115 of "..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h")
|
||||||
|
#define CUR_PAGE_NUM(addr) (addr / FLASH_PAGE_SIZE)
|
||||||
|
..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi.h(231): warning: #47-D: incompatible redefinition of macro "CUR_START_PSR" (declared at line 116 of "..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h")
|
||||||
|
#define CUR_START_PSR(addr) (addr % FLASH_PAGE_SIZE)
|
||||||
|
..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi.h(237): warning: #47-D: incompatible redefinition of macro "FMC_IDLE_STATUS" (declared at line 78 of "..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h")
|
||||||
|
#define FMC_IDLE_STATUS ((uint32_t)0x01 << 31)
|
||||||
|
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
|
void choice_mode();
|
||||||
|
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
|
void set_mode();
|
||||||
|
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
|
void Start_PWM();
|
||||||
|
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
|
void Stop_PWM();
|
||||||
|
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
|
void Set_timing();
|
||||||
|
..\app\src\PWM.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\PWM.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\PWM.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\PWM.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\fmc_spi.c(179): warning: #177-D: variable "i" was declared but never referenced
|
||||||
|
uint8_t i = 0;
|
||||||
|
..\app\src\fmc_spi.c(234): warning: #167-D: argument of type "uint8_t (*)[256]" is incompatible with parameter of type "uint8_t *"
|
||||||
|
xc_fmc_spi_flash_read_page(0x1E000,&r_data, FLASH_PAGE_SIZE);
|
||||||
|
..\app\src\fmc_spi.c: 20 warnings, 0 errors
|
||||||
|
compiling uart.c...
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
|
void choice_mode();
|
||||||
|
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
|
void set_mode();
|
||||||
|
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
|
void Start_PWM();
|
||||||
|
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
|
void Stop_PWM();
|
||||||
|
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
|
void Set_timing();
|
||||||
|
..\app\src\uart.c(153): warning: #223-D: function "temperature" declared implicitly
|
||||||
|
temperature(user_rx_buf[1]);
|
||||||
|
..\app\src\uart.c(90): warning: #177-D: variable "uart_handle" was declared but never referenced
|
||||||
|
uint8_t uart_handle = UART0_IDX;
|
||||||
|
..\app\src\uart.c(211): warning: #1-D: last line of file ends without a newline
|
||||||
|
|
||||||
|
..\app\src\uart.c: 18 warnings, 0 errors
|
||||||
|
compiling arch_main.c...
|
||||||
|
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
|
void choice_mode();
|
||||||
|
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
|
void set_mode();
|
||||||
|
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
|
void Start_PWM();
|
||||||
|
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
|
void Stop_PWM();
|
||||||
|
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
|
void Set_timing();
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\arch_main.c(163): warning: #223-D: function "xc_fmc_spi_init_oprt" declared implicitly
|
||||||
|
xc_fmc_spi_init_oprt();
|
||||||
|
..\app\src\arch_main.c(164): warning: #223-D: function "xc_fmc_spi_flash_wake_up" declared implicitly
|
||||||
|
xc_fmc_spi_flash_wake_up();
|
||||||
|
..\app\src\arch_main.c(166): warning: #223-D: function "xc_fmc_spi_flash_rdid" declared implicitly
|
||||||
|
xc_fmc_spi_flash_rdid((uint8_t *)&mid);
|
||||||
|
..\app\src\arch_main.c(171): warning: #223-D: function "xc_fmc_spi_flash_ruid" declared implicitly
|
||||||
|
xc_fmc_spi_flash_ruid(ruid);
|
||||||
|
..\app\src\arch_main.c(188): warning: #223-D: function "xc_unique_identification_read" declared implicitly
|
||||||
|
if (false == xc_unique_identification_read(co_default_bdaddr.addr)) {
|
||||||
|
..\app\src\arch_main.c(161): warning: #177-D: variable "flash_size" was declared but never referenced
|
||||||
|
uint32_t flash_size;
|
||||||
|
..\app\src\arch_main.c(162): warning: #177-D: variable "flash_type" was declared but never referenced
|
||||||
|
uint16_t flash_type;
|
||||||
|
..\app\src\arch_main.c(215): warning: #144-D: a value of type "uint32_t *" cannot be used to initialize an entity of type "uint8_t *"
|
||||||
|
uint8_t *ptr = (uint32_t *)(0x10000800);
|
||||||
|
..\app\src\arch_main.c(375): warning: #188-D: enumerated type mixed with another type
|
||||||
|
wdt_cfg.ReloadValue = WDT_CLK_32K_RESET_MODE0_8192MS;
|
||||||
|
..\app\src\arch_main.c(395): warning: #223-D: function "xc_fmc_spi_init_oprt" declared implicitly
|
||||||
|
xc_fmc_spi_init_oprt( );
|
||||||
|
..\app\src\arch_main.c(396): warning: #223-D: function "xc_fmc_spi_flash_wake_up" declared implicitly
|
||||||
|
xc_fmc_spi_flash_wake_up();
|
||||||
|
..\app\src\arch_main.c(463): warning: #223-D: function "TaskProcess" declared implicitly
|
||||||
|
TaskProcess();
|
||||||
|
..\app\src\arch_main.c: 27 warnings, 0 errors
|
||||||
|
compiling timeslice.c...
|
||||||
|
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
|
void choice_mode();
|
||||||
|
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
|
void set_mode();
|
||||||
|
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
|
void Start_PWM();
|
||||||
|
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
|
void Stop_PWM();
|
||||||
|
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
|
void Set_timing();
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\timeslice.c: 15 warnings, 0 errors
|
||||||
|
compiling Rf433.c...
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
|
void choice_mode();
|
||||||
|
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
|
void set_mode();
|
||||||
|
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
|
void Start_PWM();
|
||||||
|
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
|
void Stop_PWM();
|
||||||
|
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
|
void Set_timing();
|
||||||
|
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\Rf433.c(659): warning: #223-D: function "temperature" declared implicitly
|
||||||
|
temperature((uint8_t)(((uint16_t)(255U - res_data) * 255U + 119U) / 239U));
|
||||||
|
..\app\src\Rf433.c(24): warning: #177-D: variable "POWER_flag" was declared but never referenced
|
||||||
|
static uint8_t POWER_flag;
|
||||||
|
..\app\src\Rf433.c: 17 warnings, 0 errors
|
||||||
|
compiling Mode.c...
|
||||||
|
..\app\src\pwm.h(137): warning: #1295-D: Deprecated declaration _PWM_INIT - give arg types
|
||||||
|
void _PWM_INIT();
|
||||||
|
..\app\src\pwm.h(143): warning: #1295-D: Deprecated declaration adc_Init - give arg types
|
||||||
|
void adc_Init();
|
||||||
|
..\app\src\pwm.h(144): warning: #1295-D: Deprecated declaration My_ADC_Get_Value - give arg types
|
||||||
|
void My_ADC_Get_Value();
|
||||||
|
..\app\src\pwm.h(145): warning: #1295-D: Deprecated declaration gpio_pullup_input_inter_test - give arg types
|
||||||
|
void gpio_pullup_input_inter_test();
|
||||||
|
..\app\src\mode.h(43): warning: #1295-D: Deprecated declaration choice_mode - give arg types
|
||||||
|
void choice_mode();
|
||||||
|
..\app\src\mode.h(44): warning: #1295-D: Deprecated declaration set_mode - give arg types
|
||||||
|
void set_mode();
|
||||||
|
..\app\src\mode.h(45): warning: #1295-D: Deprecated declaration Start_PWM - give arg types
|
||||||
|
void Start_PWM();
|
||||||
|
..\app\src\mode.h(46): warning: #1295-D: Deprecated declaration Stop_PWM - give arg types
|
||||||
|
void Stop_PWM();
|
||||||
|
..\app\src\mode.h(47): warning: #1295-D: Deprecated declaration Set_timing - give arg types
|
||||||
|
void Set_timing();
|
||||||
|
..\app\src\RF433.h(185): warning: #1295-D: Deprecated declaration rf433_receive - give arg types
|
||||||
|
void rf433_receive();
|
||||||
|
..\app\src\RF433.h(186): warning: #1295-D: Deprecated declaration rf433_gpio_init - give arg types
|
||||||
|
void rf433_gpio_init();
|
||||||
|
..\app\src\RF433.h(187): warning: #1295-D: Deprecated declaration scan_433 - give arg types
|
||||||
|
void scan_433();
|
||||||
|
..\app\src\RF433.h(188): warning: #1295-D: Deprecated declaration Lock_Pwm7xd - give arg types
|
||||||
|
void Lock_Pwm7xd();
|
||||||
|
..\app\src\RF433.h(189): warning: #1295-D: Deprecated declaration Delay_50us - give arg types
|
||||||
|
void Delay_50us();
|
||||||
|
..\app\src\RF433.h(190): warning: #1295-D: Deprecated declaration Encoder_key - give arg types
|
||||||
|
void Encoder_key();
|
||||||
|
..\app\src\Mode.c: 15 warnings, 0 errors
|
||||||
linking...
|
linking...
|
||||||
Program Size: Code=27716 RO-data=1380 RW-data=2740 ZI-data=3700
|
Program Size: Code=32588 RO-data=2208 RW-data=2828 ZI-data=3856
|
||||||
FromELF: creating hex file...
|
FromELF: creating hex file...
|
||||||
After Build - User command #1: fromelf --bin --output=app.bin .\Objects\Xinc_ble_sdk.axf
|
After Build - User command #1: fromelf --bin --output=app.bin .\Objects\Xinc_ble_sdk.axf
|
||||||
After Build - User command #2: .\output_tool\ge_ota_scan.bat
|
After Build - User command #2: .\output_tool\ge_ota_scan.bat
|
||||||
Size of file: 29380 bytes.
|
Size of file: 35064 bytes.
|
||||||
all_size=29380
|
all_size=35064
|
||||||
dual_xip
|
dual_xip
|
||||||
Addr:13000
|
Addr:13000
|
||||||
Size:0x72c4
|
Size:0x88f8
|
||||||
BAddr:0x40000
|
BAddr:0x40000
|
||||||
Acheck:0x42b99760
|
Acheck:0xf227e680
|
||||||
SoftVer:0x10
|
SoftVer:0x10
|
||||||
RomVer:0x20
|
RomVer:0x20
|
||||||
LoadAddr:0x11013000
|
LoadAddr:0x11013000
|
||||||
@@ -87,7 +367,7 @@ status2=1
|
|||||||
updata file success !
|
updata file success !
|
||||||
已复制 1 个文件。
|
已复制 1 个文件。
|
||||||
已复制 1 个文件。
|
已复制 1 个文件。
|
||||||
".\Objects\Xinc_ble_sdk.axf" - 0 Error(s), 9 Warning(s).
|
".\Objects\Xinc_ble_sdk.axf" - 0 Error(s), 142 Warning(s).
|
||||||
|
|
||||||
<h2>Software Packages used:</h2>
|
<h2>Software Packages used:</h2>
|
||||||
|
|
||||||
@@ -100,7 +380,7 @@ Package Vendor: ARM
|
|||||||
D:/Program Files/Keil_v5/ARM/Packs/ARM/CMSIS/5.9.0/Device/ARM/ARMCM0/Include
|
D:/Program Files/Keil_v5/ARM/Packs/ARM/CMSIS/5.9.0/Device/ARM/ARMCM0/Include
|
||||||
|
|
||||||
<h2>Collection of Component Files used:</h2>
|
<h2>Collection of Component Files used:</h2>
|
||||||
Build Time Elapsed: 00:00:07
|
Build Time Elapsed: 00:00:08
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -42,9 +42,11 @@
|
|||||||
".\objects\rgblight.o"
|
".\objects\rgblight.o"
|
||||||
".\objects\mode.o"
|
".\objects\mode.o"
|
||||||
".\objects\rf433.o"
|
".\objects\rf433.o"
|
||||||
|
".\objects\rf433_decoder.o"
|
||||||
".\objects\pwm.o"
|
".\objects\pwm.o"
|
||||||
".\objects\bridge_pwm.o"
|
".\objects\bridge_pwm.o"
|
||||||
".\objects\light_transition.o"
|
".\objects\light_transition.o"
|
||||||
|
".\objects\external_key.o"
|
||||||
".\objects\fmc_spi.o"
|
".\objects\fmc_spi.o"
|
||||||
--strict --scatter ".\Linker\cpu_xip_scan.scat"
|
--strict --scatter ".\Linker\cpu_xip_scan.scat"
|
||||||
--feedback fb.txt --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
|
--feedback fb.txt --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -132,6 +132,8 @@
|
|||||||
.\objects\arch_main.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
.\objects\arch_main.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
.\objects\arch_main.o: ..\app\src\mode.h
|
.\objects\arch_main.o: ..\app\src\mode.h
|
||||||
.\objects\arch_main.o: ..\app\src\RF433.h
|
.\objects\arch_main.o: ..\app\src\RF433.h
|
||||||
|
.\objects\arch_main.o: ..\app\src\rf433_decoder.h
|
||||||
|
.\objects\arch_main.o: ..\app\src\external_key.h
|
||||||
.\objects\arch_main.o: ..\app\src\rgblight.h
|
.\objects\arch_main.o: ..\app\src\rgblight.h
|
||||||
.\objects\arch_main.o: ..\app\src\timer.h
|
.\objects\arch_main.o: ..\app\src\timer.h
|
||||||
.\objects\arch_main.o: ..\app\src\fmc_spi.h
|
.\objects\arch_main.o: ..\app\src\fmc_spi.h
|
||||||
|
|||||||
Binary file not shown.
+207
-72
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,63 @@
|
|||||||
|
.\objects\external_key.o: ..\app\src\external_key.c
|
||||||
|
.\objects\external_key.o: ..\app\src\external_key.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_gpio.h
|
||||||
|
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
|
||||||
|
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc6xxx.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc60xx.h
|
||||||
|
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
|
||||||
|
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cm0.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cmInstr.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cmFunc.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_conf.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_cpr.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_offset.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_cprao.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_rf.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_adc.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_aotimer.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc6xxx.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_dma.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_fmc.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_fmc_cache.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_gpio.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_i2c.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_qdec.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_pwm.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_pwm_comn.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_rtc.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\core_cm0.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_spi.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_timer.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_uart.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_wdt.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\CMSIS\Device\xc_m0_register\xc_reg_pwm_timer.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_calib.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_clock.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_systick.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_pwr.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_gpio.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_aotimer.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_timer.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_rtc.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_uart.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\ringbuffer.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_dma.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_spi.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_spi_dma.h
|
||||||
|
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\ble\modules\flash\xc6xxx_fmc_spi.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_fmc_spi_dma.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_uart_dma.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_i2c.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_sw_i2c.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_wdt.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_adc.h
|
||||||
|
.\objects\external_key.o: ..\..\..\..\..\component\xc6xx_drivers\Drivers\xc_driver\xc_drv_pwm.h
|
||||||
|
.\objects\external_key.o: ..\app\src\Mode.h
|
||||||
|
.\objects\external_key.o: ..\app\src\PWM.h
|
||||||
|
.\objects\external_key.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
|
.\objects\external_key.o: ..\app\src\RF433.h
|
||||||
|
.\objects\external_key.o: ..\app\src\timer.h
|
||||||
|
.\objects\external_key.o: ..\app\src\timeslice.h
|
||||||
Binary file not shown.
Binary file not shown.
@@ -60,3 +60,4 @@
|
|||||||
.\objects\fmc_spi.o: ..\app\src\PWM.h
|
.\objects\fmc_spi.o: ..\app\src\PWM.h
|
||||||
.\objects\fmc_spi.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
.\objects\fmc_spi.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
.\objects\fmc_spi.o: ..\app\src\RF433.h
|
.\objects\fmc_spi.o: ..\app\src\RF433.h
|
||||||
|
.\objects\fmc_spi.o: ..\app\src\timeslice.h
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -97,3 +97,5 @@
|
|||||||
.\objects\ota_flash_interface.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_trc.h
|
.\objects\ota_flash_interface.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_trc.h
|
||||||
.\objects\ota_flash_interface.o: ..\app\src\ota_protocol.h
|
.\objects\ota_flash_interface.o: ..\app\src\ota_protocol.h
|
||||||
.\objects\ota_flash_interface.o: ..\app\src\fmc_spi.h
|
.\objects\ota_flash_interface.o: ..\app\src\fmc_spi.h
|
||||||
|
.\objects\ota_flash_interface.o: ..\app\src\PWM.h
|
||||||
|
.\objects\ota_flash_interface.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -58,5 +58,80 @@
|
|||||||
.\objects\rf433.o: ..\app\src\uart.h
|
.\objects\rf433.o: ..\app\src\uart.h
|
||||||
.\objects\rf433.o: ..\app\src\mode.h
|
.\objects\rf433.o: ..\app\src\mode.h
|
||||||
.\objects\rf433.o: ..\app\src\timer.h
|
.\objects\rf433.o: ..\app\src\timer.h
|
||||||
|
.\objects\rf433.o: ..\app\src\light_transition.h
|
||||||
.\objects\rf433.o: ..\app\src\pwm.h
|
.\objects\rf433.o: ..\app\src\pwm.h
|
||||||
.\objects\rf433.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
.\objects\rf433.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
|
.\objects\rf433.o: ..\app\src\rf433_decoder.h
|
||||||
|
.\objects\rf433.o: ..\app\src\timeslice.h
|
||||||
|
.\objects\rf433.o: ..\app\src\usr_server.h
|
||||||
|
.\objects\rf433.o: ..\app\api\app_task.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_bt_defines.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip_config.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\ll\api\rwble_config.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip_config.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\inc\rwble_hl_config.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\rwble_hl_error.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\inc\rwprf_config.h
|
||||||
|
.\objects\rf433.o: ..\app\api\rwapp_config.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_swdiag.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\dbg\api\dbg_trc.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gap\gapm\gapm_int.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapm.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapm_msg.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip_task.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gap.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_bt.h
|
||||||
|
.\objects\rf433.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stddef.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_lmp.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_bt.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_hci.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_error.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_list.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\ke\api\ke_task.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\ke\api\ke_msg.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\ll\gnuarm\ll.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\reg_intc.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_intc.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\driver\reg\reg_access.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_utils.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\rwip\api\rwip.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\em\api\em_map.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_math.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_et.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\ll\api\em_map_ble.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_llcp.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_cs.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_tx_desc.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_rx_desc.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_rx_cte_desc.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_wpal.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\build\ble-full\reg\fw\_reg_em_ble_ral.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_msg_int.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gatt.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gatt_msg.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\l2cap.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\l2cap_msg.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\compiler\gnuarm\compiler.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\common\api\co_buf.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\modules\ke\api\ke_mem.h
|
||||||
|
.\objects\rf433.o: ..\app\src\ota_server.h
|
||||||
|
.\objects\rf433.o: ..\app\api\app_task.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gatt_server_api.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_db.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gap_api.h
|
||||||
|
.\objects\rf433.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapc_msg.h
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
|||||||
|
.\objects\rf433_decoder.o: ..\app\src\rf433_decoder.c
|
||||||
|
.\objects\rf433_decoder.o: ..\app\src\rf433_decoder.h
|
||||||
|
.\objects\rf433_decoder.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
|
||||||
|
.\objects\rf433_decoder.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
|
||||||
|
.\objects\rf433_decoder.o: ..\app\src\rf433_decoder_port.h
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -60,6 +60,7 @@
|
|||||||
.\objects\timeslice.o: ..\app\src\timer.h
|
.\objects\timeslice.o: ..\app\src\timer.h
|
||||||
.\objects\timeslice.o: ..\app\src\mode.h
|
.\objects\timeslice.o: ..\app\src\mode.h
|
||||||
.\objects\timeslice.o: ..\app\src\RF433.h
|
.\objects\timeslice.o: ..\app\src\RF433.h
|
||||||
|
.\objects\timeslice.o: ..\app\src\rf433_decoder.h
|
||||||
.\objects\timeslice.o: ..\app\src\ota_flash_interface.h
|
.\objects\timeslice.o: ..\app\src\ota_flash_interface.h
|
||||||
.\objects\timeslice.o: ..\app\src\ota_protocol.h
|
.\objects\timeslice.o: ..\app\src\ota_protocol.h
|
||||||
.\objects\timeslice.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h
|
.\objects\timeslice.o: ..\..\..\..\..\component\ble\plf\refip\src\arch\arch.h
|
||||||
@@ -137,3 +138,4 @@
|
|||||||
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_db.h
|
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\src\gatt\gatt_db.h
|
||||||
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gap_api.h
|
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\api\xc_gap_api.h
|
||||||
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapc_msg.h
|
.\objects\timeslice.o: ..\..\..\..\..\component\ble\ip\ble\hl\api\gapc_msg.h
|
||||||
|
.\objects\timeslice.o: ..\app\src\external_key.h
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -63,3 +63,4 @@
|
|||||||
.\objects\uart_1.o: ..\app\src\rgblight.h
|
.\objects\uart_1.o: ..\app\src\rgblight.h
|
||||||
.\objects\uart_1.o: ..\app\src\mode.h
|
.\objects\uart_1.o: ..\app\src\mode.h
|
||||||
.\objects\uart_1.o: ..\app\src\timeslice.h
|
.\objects\uart_1.o: ..\app\src\timeslice.h
|
||||||
|
.\objects\uart_1.o: ..\app\src\fmc_spi.h
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -128,3 +128,4 @@
|
|||||||
.\objects\usr_server.o: ..\app\src\Mode.h
|
.\objects\usr_server.o: ..\app\src\Mode.h
|
||||||
.\objects\usr_server.o: ..\app\src\PWM.h
|
.\objects\usr_server.o: ..\app\src\PWM.h
|
||||||
.\objects\usr_server.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
.\objects\usr_server.o: D:\Program Files\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
|
.\objects\usr_server.o: ..\app\src\fmc_spi.h
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user