Przeglądaj źródła

修改mac地址 添加返回运行时间 运行固件版本号

liuhao 3 lat temu
rodzic
commit
561feabb68

+ 5 - 3
YC11xx_SmartLight/Librarier/sc_user/u_app_handler.c

@@ -9,12 +9,10 @@
 #include "user_driver.h"
 #include "LH_TaskManager.h"
 
-#define firmware_version "YC1166_V1.0.0"
+
 
 uint32_t 	m_clr_play_buff[APP_MODE_CLR_MAX_NUM] 		= {0x00};
 AppModeInfo_t   m_app_mode_info[APP_MODE_SCENE_MAX_NUM] 	= {0x00};
-
-
 void app_mode_info_init(void)
 {
 	
@@ -414,6 +412,10 @@ void light_mode_set(uint8_t *app_mode)
 			{
 				g_light_para.mic_AppOrDriver = 1;
 				app_rhythm_enter(app_mode);
+				if(g_light_para.rhythm_mode!=RHYTHM_MODE_STOP)//增加对律动保存功能支持 2021/10/12 liuhao
+				{
+						u_rhythm_timer_ctrl(GLO_EN);
+				}
 			}else if(g_light_para.mic == 0)
 			{
 				g_light_para.mic_AppOrDriver=0;

+ 3 - 1
YC11xx_SmartLight/Librarier/sc_user/u_ble.c

@@ -45,7 +45,8 @@ void u_ble_data_recv(uint8_t *ble_data, uint16_t recv_len)
 	//ble_data_send(ble_data, recv_len);
 	uint8_t i = 0;
 	uint16_t crc, tmp;
-	
+	if(recv_len>=4)
+	{
 	tmp = ble_data[recv_len-1];
 	tmp = (tmp<<8) | ble_data[recv_len-2];
 	
@@ -62,6 +63,7 @@ void u_ble_data_recv(uint8_t *ble_data, uint16_t recv_len)
 	{
 		decode_app_cmd(ble_data[1], &ble_data[3], ble_data[2]);
 	}
+	}
 
 }
 #if 0

+ 2 - 0
YC11xx_SmartLight/Librarier/sc_user/u_global.h

@@ -14,6 +14,8 @@
 //typedef unsigned char u8;
 //typedef unsigned short u16;
 //#define u32 (unsigned int);
+#define firmware_version "YC1166_V1.0.3"						//	¹Ì¼þ°æ±¾ºÅ
+#define firmware_is_mic		0													//ÊÇ·ñÖ§³Ömic
 
 // Firmware Revision
 #define U_DIS_FW_REV_STR      	    ("0220")

+ 75 - 12
YC11xx_SmartLight/Librarier/sc_user/u_light_ctrl.c

@@ -346,6 +346,37 @@ void rc_mode_enter(uint8_t rc_mode)
 			light_mode_jump_cfg(&g_light_info, base_clr, 7, g_light_para.speed*2, g_light_para.bright);
 		}
 		break;
+		
+		case RC_MODE_RHYTM_MUSIC1:
+		{
+						g_light_para.mic_AppOrDriver = 1;
+						light_rhythm_enter(RHYTHM_MODE_FADE_7);
+						u_rhythm_timer_ctrl(GLO_EN);
+		}
+		break;
+
+		case RC_MODE_RHYTM_MUSIC2:
+		{
+						 g_light_para.mic_AppOrDriver = 1;
+						 light_rhythm_enter(RHYTHM_MODE_FADE_3);
+						 u_rhythm_timer_ctrl(GLO_EN);
+		}
+		break;
+
+		case RC_MODE_RHYTM_MUSIC3:
+		{
+						 g_light_para.mic_AppOrDriver = 1;
+						 light_rhythm_enter(RHYTHM_MODE_JUMP_3);
+						 u_rhythm_timer_ctrl(GLO_EN);
+		}
+		break;
+		case RC_MODE_RHYTM_MUSIC4:
+		{
+						 g_light_para.mic_AppOrDriver = 1;
+						 light_rhythm_enter(RHYTHM_MODE_JUMP_7);
+						 u_rhythm_timer_ctrl(GLO_EN);
+		}
+		break;
 		default:
 		{
 			
@@ -634,32 +665,64 @@ void ir_decode(const uint8_t *ir_code)
 						rc_mode_enter(RC_MODE_COLOR_6);
 					}
 					break;
+//					case RC_CODE_MUSIC1_20:
+//					{
+//						g_light_para.mic_AppOrDriver = 1;
+//						light_rhythm_enter(RHYTHM_MODE_FADE_7);
+//						u_rhythm_timer_ctrl(GLO_EN);
+//					}
+//					break;
+//					case RC_CODE_MUSIC2_20:
+//					{
+//						g_light_para.mic_AppOrDriver = 1;
+//						light_rhythm_enter(RHYTHM_MODE_FADE_3);
+//						u_rhythm_timer_ctrl(GLO_EN);
+//					}
+//					break;
+//					case RC_CODE_MUSIC3_20:
+//					{
+//						g_light_para.mic_AppOrDriver = 1;
+//						light_rhythm_enter(RHYTHM_MODE_JUMP_3);
+//						u_rhythm_timer_ctrl(GLO_EN);
+//					}
+//					break;
+//					case RC_CODE_MUSIC4_20:
+//					{
+//						g_light_para.mic_AppOrDriver = 1;
+//						light_rhythm_enter(RHYTHM_MODE_JUMP_7);
+//						u_rhythm_timer_ctrl(GLO_EN);
+//					}
+//					break;
 					case RC_CODE_MUSIC1_20:
 					{
-						g_light_para.mic_AppOrDriver = 1;
-						light_rhythm_enter(RHYTHM_MODE_FADE_7);
-						u_rhythm_timer_ctrl(GLO_EN);
+						//g_light_para.mic_AppOrDriver = 1;
+						//light_rhythm_enter(RHYTHM_MODE_FADE_7);
+						//u_rhythm_timer_ctrl(GLO_EN);
+						rc_mode_enter(RC_MODE_RHYTM_MUSIC1);
 					}
 					break;
 					case RC_CODE_MUSIC2_20:
 					{
-						g_light_para.mic_AppOrDriver = 1;
-						light_rhythm_enter(RHYTHM_MODE_FADE_3);
-						u_rhythm_timer_ctrl(GLO_EN);
+						//g_light_para.mic_AppOrDriver = 1;
+						//light_rhythm_enter(RHYTHM_MODE_FADE_3);
+						//u_rhythm_timer_ctrl(GLO_EN);
+						rc_mode_enter(RC_MODE_RHYTM_MUSIC2);
 					}
 					break;
 					case RC_CODE_MUSIC3_20:
 					{
-						g_light_para.mic_AppOrDriver = 1;
-						light_rhythm_enter(RHYTHM_MODE_JUMP_3);
-						u_rhythm_timer_ctrl(GLO_EN);
+						//g_light_para.mic_AppOrDriver = 1;
+						//light_rhythm_enter(RHYTHM_MODE_JUMP_3);
+						//u_rhythm_timer_ctrl(GLO_EN);
+						rc_mode_enter(RC_MODE_RHYTM_MUSIC3);
 					}
 					break;
 					case RC_CODE_MUSIC4_20:
 					{
-						g_light_para.mic_AppOrDriver = 1;
-						light_rhythm_enter(RHYTHM_MODE_JUMP_7);
-						u_rhythm_timer_ctrl(GLO_EN);
+						//g_light_para.mic_AppOrDriver = 1;
+						//light_rhythm_enter(RHYTHM_MODE_JUMP_7);
+						//u_rhythm_timer_ctrl(GLO_EN);
+						rc_mode_enter(RC_MODE_RHYTM_MUSIC4);
 					}
 					break;
 					case RC_CODE_FADE7_20:

+ 4 - 0
YC11xx_SmartLight/Librarier/sc_user/u_light_ctrl.h

@@ -98,6 +98,10 @@ enum //_rc_mode
 	RC_CODE_JUMP3,
 	RC_CODE_JUMP7,
 	
+	RC_MODE_RHYTM_MUSIC1,
+	RC_MODE_RHYTM_MUSIC2,
+	RC_MODE_RHYTM_MUSIC3,
+	RC_MODE_RHYTM_MUSIC4,
 };
 
 typedef enum //_rc_mode_switch_dir

+ 4 - 0
YC11xx_SmartLight/Librarier/sc_user/u_main.c

@@ -20,7 +20,11 @@ LightPara_t g_light_para = {0x00};
 
 void mic_estimate_gpio_int(void)
 {
+	#if (firmware_is_mic==1)
 	g_light_para.mic=1;
+	#else
+	g_light_para.mic=0;
+	#endif
 //	GPIO_config(2,2,0);
 //	GPIO_config(3,1,2);	
 //	delay_ms(1);

+ 3 - 2
YC11xx_SmartLight/Librarier/user/user_driver.c

@@ -189,7 +189,8 @@ extern MIC_CUR_VARIABLE sMicCurVariable;
 void Audio_sampling_init()
 {
 	DRV_Mic_Init();
-	DRV_Mic_Enable();
+	//DRV_Mic_Enable();
+	DRV_Mic_Disable();
 }
 /*
  * @method Audio_get_buffer_len
@@ -319,7 +320,7 @@ void Audio_to_uart_start()
 			   
 			   audioVal = *(testPtr+ indexL);
 			   Audio_Buffer[indexL]=abs(audioVal);
-				// MyPrintf("v:%d\r\n",audioVal);//计算分贝值打印 
+				 //MyPrintf("v:%d\r\n",audioVal);//计算分贝值打印 
 //			   if(audioVal>0)
 //				 {
 //			   if(audioVal<AudioValMin)

Plik diff jest za duży
+ 160 - 160
YC11xx_SmartLight/ModuleDemo/SmartLight_Prj/Prj/MDK/Objects/output/flash.dat


Plik diff jest za duży
+ 160 - 160
YC11xx_SmartLight/ModuleDemo/SmartLight_Prj/Prj/MDK/Objects/output/flash_final.dat


Plik diff jest za duży
+ 282 - 279
YC11xx_SmartLight/ModuleDemo/SmartLight_Prj/Prj/MDK/Objects/output/out.rom


+ 14 - 2
YC11xx_SmartLight/ModuleDemo/SmartLight_Prj/Prj/MDK/Objects/output/版本更新记录.txt

@@ -1,4 +1,16 @@
-更新说明:
+V1.0.1更新说明:
 2021/10/06
 ==========
-1.修改了RGB的IO定义。
+1.修改了RGB的IO定义。
+
+V1.0.2更新说明:
+2021/10/13
+==========
+1.修改了短路保护阈值,解决硬件pcb板子压降大引起的问题
+2.增加了遥控和app控制律动状态下的掉电保存功能。
+
+V1.0.3更新说明:
+2021/10/15
+==========
+1.增加app读取固件版本号,设备运行时间功能
+2.修改固件mac地址为原来官方代码的值

Plik diff jest za duży
+ 6 - 7
YC11xx_SmartLight/ModuleDemo/SmartLight_Prj/Prj/MDK/yc11xx.uvguix.liuhao


+ 2 - 1
YC11xx_SmartLight/ModuleDemo/SmartLight_Prj/User/main.c

@@ -239,7 +239,8 @@ tIPCHandleCb gTIPCHandleCb[IPC_TYPE_NUM]=
 void Bt_Reset()
 {
 	uint8_t advD[22] = {0x02,0x01,0x06,0x05,0x03,0x12,0x18,0x0f,0x18,0x03,0x19,0x80,0x01,0x08,0x09,0x31,0x31,0x58,0x58,0x42,0x4c,0x45};
-	uint8_t addr[6]  = {0xF1,0x02,0x88,0x11,0x43,0XF1};
+//	uint8_t addr[6]  = {0xF1,0x02,0x88,0x11,0x43,0XF1};
+	uint8_t addr[6]  = {0xac,0x02,0x88,0x11,0x43,0Xac};//官方代码mac地址
 	uint8_t name[] = {"Smart Light"};//Light Life
 	Bt_Renew_Le_AdvData(advD,22);
  	Bt_SetLeMac(addr);									//设置蓝牙地址 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików