解耦test,example,重构effect为C(解决 #4 #6)

This commit is contained in:
2023-11-25 16:36:04 +08:00
parent 5024b92298
commit 1d8c7663f1
20 changed files with 242 additions and 217 deletions

View File

@@ -0,0 +1,22 @@
/** @brief 测试 HSV_to_RGB以及饱和处理
* @author Vergil Wong
* @date 2023-11-25
* @param
* @return
*/
#include <platform.h> // 包含对封装的定义,引用以使用 on tile[] 语法
extern "C"
{
void test_hsv_to_rgb();
}
int main() // 定义主函数
{
par
{
on tile[1]: test_hsv_to_rgb();
}
return 0; // 返回0表示程序正常结束
}

View File

@@ -0,0 +1,16 @@
#include <stdint.h>
#include "rgb_effect.h"
void test_hsv_to_rgb()
{
uint32_t hue, sat, value; // HSV值
uint32_t color; // RGB值
// 测试转换
hue = 999;
sat = 999;
value = 999;
color = HSV_to_RGB(&hue, &sat, &value);
printf("GRB color is: 0x%06X\n", color);
}