編輯:關於Android編程
#define IR_HEAD0 0#define IR_HEAD1 1 #define IR_TIME_BASE 2 #define IR_CODE_0 3 #define IR_CODE_1 4 #define IR_CODE_END 5 #define TIMER_9000US 10500 #define TIMER_4500US 5710 #define TIMER_560US 720 #define TIMER_1680US 2135SendIR(const U16 head, const U16 keycode,const BOOL outreverse) { S8 TranselateBitPos; U8 Ir_trans_sta; int count = 0; U8 head0 = head >> 8; U8 head1 = head &0x00ff; Ir_trans_sta=IR_HEAD0; TranselateBitPos=32; printf("\n yanxi head:%d keycode:%d outreverse:%d",head,keycode,outreverse); while(TranselateBitPos>=0) { switch(Ir_trans_sta) { case IR_HEAD0: Ir_trans_sta= IR_HEAD1; for(count=TIMER_9000US;count>0;count--) SetGpioDeviceStatus(LED_WORK,!outreverse); break; case IR_HEAD1: Ir_trans_sta= IR_TIME_BASE; for(count=TIMER_4500US;count>0;count--) SetGpioDeviceStatus(LED_WORK,outreverse); break; case IR_TIME_BASE: if(TranselateBitPos>24) { if( ((head0>>(32-TranselateBitPos)) && 0x1) == 0x1 ) Ir_trans_sta= IR_CODE_1; else Ir_trans_sta= IR_CODE_0; } else if(TranselateBitPos>16) { if( ((head1>>(24-TranselateBitPos)) && 0x1) == 0x1 ) Ir_trans_sta= IR_CODE_1; else Ir_trans_sta= IR_CODE_0; } else if(TranselateBitPos>8) { if( ((keycode>>(16-TranselateBitPos)) && 0x1) == 0x1 ) Ir_trans_sta= IR_CODE_1; else Ir_trans_sta= IR_CODE_0; } else if(TranselateBitPos>0) { if( ((keycode>>(8-TranselateBitPos)) && 0x1) == 0x1 ) Ir_trans_sta= IR_CODE_0; else Ir_trans_sta= IR_CODE_1; } else { Ir_trans_sta= IR_CODE_END; } for(count=TIMER_560US;count>0;count--) SetGpioDeviceStatus(LED_WORK,!outreverse); break; case IR_CODE_0: Ir_trans_sta= IR_TIME_BASE; for(count=TIMER_560US;count>0;count--) SetGpioDeviceStatus(LED_WORK,outreverse); TranselateBitPos--; break; case IR_CODE_1: Ir_trans_sta= IR_TIME_BASE; for(count=TIMER_1680US;count>0;count--) SetGpioDeviceStatus(LED_WORK,outreverse); TranselateBitPos--; break; case IR_CODE_END: Ir_trans_sta= IR_HEAD0; SetGpioDeviceStatus(LED_WORK,outreverse); TranselateBitPos=-1;//force to exit. break; default:break; } } }
在這篇文章中,我將向大家展示如何從相冊截圖。先看看效果圖:上一篇文章中,我就拍照截圖這一需求進行了詳細的分析,試圖讓大家了解Android本身的限制,以及我們應當采取的實
項目需要做了一個調節屏幕的工具類/* * Android調節屏幕亮度工具類 * by itas109 * http://blog.csdn.net
最近項目裡要做一個簡單的曲線圖來標識數據,開始以為很簡單,android已經有那麼多的開源圖表庫了,什麼achartenginee,hellochart,mpandroi
android4.4 webview chromium是單進程的,圖中所有組件都運行在Browser進程中。 按從上而下的順序介紹這張圖中與顯示網頁相關的chromiu