|  | 
 
 發表於 2012年12月31日 09:56 PM
|
顯示全部樓層 
| ~~請教SUV~~ 
 
 我編了一段 PPM-IN 程式碼 , 可以做到:
 (1) 由耳機接口(右聲道, GPIO-PA10) 接收
 (2) 捕捉同步信號(Sync)
 (3) 計算有幾個通道信號(ppmin_num_channels)
 (4) 儲存各個通道信號值(ppmChannels:channel width), 或 將通道信號值直接寫入Channels
 
  protocol_ppmin.zip
(3.42 KB, 下載次數: 160) 
 請問我該從何處插入ppm-in 信號 ??
 
 是否從 mixer.c 的 MIXER_CalcChannels() 插入 , 替代Channels  !!
 ======mixer.c======
 void MIXER_CalcChannels()
 {
 //We retain this array so that we can refer to the prevous values in the next iteration
 int i;
 //1st step: Read Tx inputs
 MIXER_UpdateRawInputs();
 //3rd steps
 MIXER_EvalMixers(raw);    //4th step: apply auto-templates
 for (i = 0; i < NUM_OUT_CHANNELS; i++) {
 ......
 }
 if (ppmIN && ppmSync) {
 // PPM-IN 程式碼 將寫入Channels
 } else {
 //5th step: apply limits
 for (i = 0; i < NUM_OUT_CHANNELS; i++) {
 Channels = MIXER_ApplyLimits(i, &Model.limits, raw, Channels, APPLY_ALL);
 }
 }
 =================
 
 [ 本帖最後由 hmjack2008 於 2012年12月31日 10:11 PM 編輯 ]
 | 
 |