mirror of
				https://github.com/pvvx/RTL00MP3.git
				synced 2025-07-31 12:41:06 +00:00 
			
		
		
		
	update
This commit is contained in:
		
							parent
							
								
									c32ef5a08d
								
							
						
					
					
						commit
						4b5455f7d1
					
				
					 14 changed files with 2379 additions and 2354 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,3 @@
 | 
			
		|||
buildTools.path=D\:\\MCU\\GNU_Tools_ARM_Embedded\\5.4_2016q2\\bin
 | 
			
		||||
buildTools.path=D\:\\MCU\\GNU_Tools_ARM_Embedded\\6.2017-q1-update\\bin
 | 
			
		||||
eclipse.preferences.version=1
 | 
			
		||||
toolchain.path.1287942917=D\:\\MCU\\GNU_Tools_ARM_Embedded\\5.4_2016q2\\
 | 
			
		||||
toolchain.path.1287942917=D\:\\MCU\\GNU_Tools_ARM_Embedded\\6.2017-q1-update\\
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -657,7 +657,6 @@ void fATSR(void *arg) {
 | 
			
		|||
 | 
			
		||||
void fATSV(void *arg) {
 | 
			
		||||
	char at_buf[32];
 | 
			
		||||
	char fw_buf[32];
 | 
			
		||||
	char cspimode[4] = { 'S', 'D', 'Q', '?' };
 | 
			
		||||
 | 
			
		||||
	if (fspic_isinit == 0) {
 | 
			
		||||
| 
						 | 
				
			
			@ -675,9 +674,8 @@ void fATSV(void *arg) {
 | 
			
		|||
	strcpy(at_buf, ATCMD_VERSION"."ATCMD_SUBVERSION"."ATCMD_REVISION);
 | 
			
		||||
 | 
			
		||||
	// get fw version
 | 
			
		||||
	strcpy(fw_buf, SDK_VERSION);
 | 
			
		||||
	printf("%s,%s(%s)\n", at_buf, fw_buf, RTL8195AFW_COMPILE_TIME);
 | 
			
		||||
	at_printf("\r\n[ATSV] OK:%s,%s(%s)", at_buf, fw_buf,
 | 
			
		||||
	printf("%s,%s(%s)\n", at_buf, SDK_VERSION, RTL8195AFW_COMPILE_TIME);
 | 
			
		||||
	at_printf("\r\n[ATSV] OK:%s,%s(%s)", at_buf, SDK_VERSION,
 | 
			
		||||
			RTL8195AFW_COMPILE_TIME);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,8 +34,13 @@ void sys_recover_ota_signature(void);
 | 
			
		|||
void sys_log_uart_on(void);
 | 
			
		||||
void sys_log_uart_off(void);
 | 
			
		||||
void sys_adc_calibration(u8 write, u16 *offset, u16 *gain);
 | 
			
		||||
u8   sys_is_sdram_power_on(void);
 | 
			
		||||
#ifdef	CONFIG_SDR_EN
 | 
			
		||||
void sys_sdram_off(void);
 | 
			
		||||
u8   sys_is_sdram_power_on(void);
 | 
			
		||||
#else
 | 
			
		||||
#define sys_sdram_off()
 | 
			
		||||
#define sys_is_sdram_power_on() (0)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *  @brief   system software reset
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -203,28 +203,16 @@ void sys_reset(void)
 | 
			
		|||
	                              (1 << 2));                                  // SYSRESETREQ
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef	CONFIG_SDR_EN
 | 
			
		||||
u8 sys_is_sdram_power_on(void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef	CONFIG_SDR_EN
 | 
			
		||||
//	u8 ison = 0;
 | 
			
		||||
 | 
			
		||||
//#if defined ( __ICCARM__ )
 | 
			
		||||
	return IsSdrPowerOn();
 | 
			
		||||
//#endif
 | 
			
		||||
 | 
			
		||||
//	return ison;
 | 
			
		||||
#else
 | 
			
		||||
	return 0;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void sys_sdram_off(void)
 | 
			
		||||
{
 | 
			
		||||
#ifdef	CONFIG_SDR_EN
 | 
			
		||||
//#if defined ( __ICCARM__ )
 | 
			
		||||
	if (IsSdrPowerOn()) {
 | 
			
		||||
		SdrPowerOff();
 | 
			
		||||
	}
 | 
			
		||||
//#endif
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -201,6 +201,39 @@ void acquire_wakelock(uint32_t lock_id) {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
#if 0
 | 
			
		||||
void pmu_acquire_wakelock(uint32_t lock_id) {
 | 
			
		||||
 | 
			
		||||
    wakelock |= BIT(lock_id);
 | 
			
		||||
#if (configGENERATE_RUN_TIME_STATS == 1)
 | 
			
		||||
	    uint32_t i;
 | 
			
		||||
        uint32_t current_timestamp = osKernelSysTick();
 | 
			
		||||
        for (i=0; i<32; i++) {
 | 
			
		||||
            if ( (1<<i & BIT(lock_id)) && (last_wakelock_state[i] == 0) ) {
 | 
			
		||||
                last_acquire_wakelock_time[i] = current_timestamp;
 | 
			
		||||
                last_wakelock_state[i] = 1;            
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void pmu_release_wakelock(uint32_t lock_id) {
 | 
			
		||||
    wakelock &= ~BIT(lock_id);
 | 
			
		||||
 | 
			
		||||
#if (configGENERATE_RUN_TIME_STATS == 1)
 | 
			
		||||
    if (generate_wakelock_stats) {
 | 
			
		||||
        uint32_t i;
 | 
			
		||||
        uint32_t current_timestamp = osKernelSysTick();
 | 
			
		||||
        for (i=0; i<32; i++) {
 | 
			
		||||
            if ( (1<<i & BIT(lock_id)) && (last_wakelock_state[i] == 1) ) {
 | 
			
		||||
                hold_wakelock_time[i] += current_timestamp - last_acquire_wakelock_time[i];
 | 
			
		||||
                last_wakelock_state[i] = 0;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void release_wakelock(uint32_t lock_id) {
 | 
			
		||||
    wakelock &= ~lock_id;
 | 
			
		||||
| 
						 | 
				
			
			@ -218,6 +251,7 @@ void release_wakelock(uint32_t lock_id) {
 | 
			
		|||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
uint32_t get_wakelock_status() {
 | 
			
		||||
    return wakelock;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -114,10 +114,10 @@ void register_post_sleep_callback( freertos_sleep_callback post_sleep_cb );
 | 
			
		|||
void set_pll_reserved(unsigned char reserve);
 | 
			
		||||
 | 
			
		||||
/* SDK 4.0a compatible */
 | 
			
		||||
#define pmu_release_wakelock release_wakelock
 | 
			
		||||
#define pmu_acquire_wakelock acquire_wakelock
 | 
			
		||||
#define pmu_acquire_wakelock(nDeviceId) acquire_wakelock(1<<(nDeviceId))
 | 
			
		||||
#define pmu_release_wakelock(nDeviceId) release_wakelock(1<<(nDeviceId))
 | 
			
		||||
#define pmu_get_wakelock_status get_wakelock_status
 | 
			
		||||
#define pmu_set_pll_reserved set_pll_reserved
 | 
			
		||||
#define pmu_enable_wakelock_stats
 | 
			
		||||
#define pmu_set_pll_reserved set_pll_reserved
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										4631
									
								
								build/obj/build.nmap
									
										
									
									
									
								
							
							
						
						
									
										4631
									
								
								build/obj/build.nmap
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							| 
						 | 
				
			
			@ -328,12 +328,12 @@ LOCAL void fATSP(int argc, char *argv[])
 | 
			
		|||
		switch (argv[1][0]) {
 | 
			
		||||
		case 'a': // acquire
 | 
			
		||||
		{
 | 
			
		||||
			pmu_acquire_wakelock(atoi(argv[2]));
 | 
			
		||||
			acquire_wakelock(atoi(argv[2]));
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		case 'r': // release
 | 
			
		||||
		{
 | 
			
		||||
			pmu_release_wakelock(atoi(argv[2]));
 | 
			
		||||
			release_wakelock(atoi(argv[2]));
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
		};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -226,18 +226,25 @@ LOCAL void fATSF(int argc, char *argv[])
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
LOCAL void fATWP(int argc, char *argv[]) {
 | 
			
		||||
	int x = 0;
 | 
			
		||||
	if(argc > 1) {
 | 
			
		||||
		pmu_release_wakelock(0xffff);
 | 
			
		||||
		wifi_set_power_mode(1, 1);
 | 
			
		||||
		wifi_set_lps_dtim(atoi(argv[1]));
 | 
			
		||||
		x = atoi(argv[1]);
 | 
			
		||||
		if(x == 0) {
 | 
			
		||||
			acquire_wakelock(~WAKELOCK_WLAN);
 | 
			
		||||
			release_wakelock(0xffff);
 | 
			
		||||
			_wext_enable_powersave(0, 0, 0);
 | 
			
		||||
			_wext_set_lps_dtim(0, 1);
 | 
			
		||||
		} else {
 | 
			
		||||
			release_wakelock(~WAKELOCK_WLAN);
 | 
			
		||||
			_wext_enable_powersave(0, 1, 1);
 | 
			
		||||
			_wext_set_lps_dtim(0, x);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	else {
 | 
			
		||||
		unsigned char x;
 | 
			
		||||
		if(wifi_get_lps_dtim(&x) >= 0) {
 | 
			
		||||
			printf("DTIM: %d\n", x);
 | 
			
		||||
		}
 | 
			
		||||
		printf("DTIM: %d\n", _wext_get_lps_dtim(0));
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* --------  WiFi Scan ------------------------------- */
 | 
			
		||||
LOCAL void scan_result_handler(internal_scan_handler_t* ap_scan_result)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -318,7 +325,7 @@ MON_RAM_TAB_SECTION COMMAND_TABLE console_cmd_wifi_api[] = {
 | 
			
		|||
		{"ATWT", 1, fATWT, "=<tx_power>: WiFi tx power: 0 - 100%, 1 - 75%, 2 - 50%, 3 - 25%, 4 - 12.5%"},
 | 
			
		||||
		{"ATSF", 0, fATSF, ": Test TSF value"},
 | 
			
		||||
#endif
 | 
			
		||||
		{"ATWP", 0, fATWP, ": WiFi power"},
 | 
			
		||||
//		{"ATWP", 0, fATWP, "=[dtim]: 0 - WiFi ipc/lpc off, 1..10 - on + dtim"},
 | 
			
		||||
		{"ATSN", 0, fATSN, ": Scan networks"}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue