turbo.c

来自「PMU programming in eCos.」· C语言 代码 · 共 39 行

C
39
字号
//============================================================================
//        Include
//============================================================================

#include <stdio.h>
#include <cyg/kernel/kapi.h>
#include <cyg/io/pmu/fie702x_pmu.h>
#include "PMUSystem.h"

//============================================================================
//        Global Variables
//============================================================================

cyg_io_handle_t pmu_handle, rtc_handle;
int turbo_switch = 0;

int main (void)
{	
	int err;
	
	err = cyg_io_lookup( "/dev/pmu", &pmu_handle );

	if (ENOERR != err) 
	{
		printf("Can't open '%s'\n", "/dev/pmu");
	}
	
	while (1)
	{
		cyg_thread_delay (100);
		
		turbo_switch = 1 - turbo_switch;
		
		API_PMU_do_Turbo(pmu_handle, turbo_switch);		
		
		printf("turbo = %d\n", API_PMU_get_Turbo(pmu_handle));	
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?