• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 請問一下底下的程式~~為什麼設不過去啊
#5
高級會員
高級會員


查看用戶資訊
這個問題好像解決了~~~
好像在別的程式鎖住了~~~
改一下設定的參數~~
問題就解決了~~~抱歉啊版主~~~

昨天看別的文章好像也有這類的情形~~
想到是否也有這個可能~~~
還真的是鎖住了~~慘勒

發表於: 2005/4/7 9:13
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問一下底下的程式~~為什麼設不過去啊
#4
高級會員
高級會員


查看用戶資訊

1. 是否用軟體模擬檢查過 ? 當 conti_flag == set_humil 時 , 程式是否會執行到第二個 case !

這個我有檢查過了正常~有到第二個CASE

2. 若有執行到第二個 case , 那 cheakbits.cheakflash = 3 這個動作是否也不對 ?

對啊~~他在這個地方會設不過去~~~

正確應該說~~一到第二各CASE~~這種要設定的都會設不過去
好奇怪咧

發表於: 2005/4/6 14:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問一下底下的程式~~為什麼設不過去啊
#3
高級會員
高級會員


查看用戶資訊
不好意思啊~~因為程式碼很多~~只PO了一點點上去
我是在DEBUGGER中~~設中斷點等程式跑到我要停的位置停下
然後再用單步執行~~~
flashbits.tempflash=0;
flashbits.humilflash=0;
flashbits.ppmflash=0;
flashbits.groupflash=0;
flashbits.unitflash=0;
flashbits.timehflash=0;
flashbits.timemflash=0;
就例如這幾行程式,只是單純的把這幾個旗標歸零,
但是就是沒法設成零,不知道這是什麼情形~~
是我的程式有問題嗎??
還是發生了什麼事情??

struct cheakflash
{
unsigned tempflash:1;
unsigned humilflash:1;
unsigned ppmflash:1;
unsigned groupflash:1;
unsigned unitflash:1;
unsigned timehflash:1;
unsigned timemflash:1;
}flashbits;
這個宣告完~~應該就可以單一各BIT控制了吧~~
一直在找這個問題~~困惑了好幾天了~~請各位前輩幫幫忙~
否有遇過這種情形咧??

發表於: 2005/4/6 13:53
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問一下底下的程式~~為什麼設不過去啊
#2
管理員
管理員


查看用戶資訊
請問 :

1. 是否用軟體模擬檢查過 ? 當 conti_flag == set_humil 時 , 程式是否會執行到第二個 case !

2. 若有執行到第二個 case , 那 cheakbits.cheakflash = 3 這個動作是否也不對 ?

通常 case 到對應的 break 並不需用 { } 括起來 , 但是有也沒差啦 !

最後 , 如果您在 copy 程式時沒少選了 , 整個 switch statement 好像少了一個 } .

發表於: 2005/4/5 22:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問一下底下的程式~~為什麼設不過去啊
#1
高級會員
高級會員


查看用戶資訊
struct oldkey
        
{
            
unsigned oldfan:2;
            
unsigned oldmode:3;
            
unsigned setppmf:1;
            
unsigned sleepf:1;
        }
oldbits;
struct time
        
{
            
unsigned timehf:1;
            
unsigned timemf:1;
            
unsigned timeenf:1;
            
unsigned setonhf:1;
            
unsigned setonmf:1;
            
unsigned setoffhf:1;
            
unsigned setoffmf:1;
        }
timebits;
    switch (
conti_flag)
            {                  case 
set_temps:                           {
            
set_temp nowuse ;            nowuse set_humil;
                
cheakbits.cheakflash 2;
    
tempbits.tempf 0;
tempbits.humilf 1;
    
conti_flag set_humils;
    
actbits.enterf 1;
    break;
    }                    case 
set_humils:
    {                    
set_humil nowuse ;
    
nowuse set_ppm;
    
cheakbits.cheakflash 3;//FLASH PPM
    
tempbits.humilf 0;<<<<<<<<<<<<<<
    
oldbits.setppmf 1;<<<<<<<<<<<<<<
                
conti_flag set_ppms;<<<<<<<<<<<<
    
actbits.enterf 1;<<<<<<<<<<<<<<<
    
datamap[0][42] = 0;<<<<<<<<<<<<<
    
datamap[3][44] = 1;<<<<<<<<<<<<<<
    
value_limit 9999;<<<<<<<<<<<<<<<
    break;
    }



第一個CASE好好的為什麼等到第二個CASE有標誌的程式,程式有走過去~~怎麼那些參數的數值不會改變,為什麼會這樣呢~~是程式的問題還是有哪邊設錯了嗎
麻煩有大大可以幫我解決一下嗎謝謝

發表於: 2005/4/4 20:10
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------