Changeset 26 in svn for trunk/zasc/app_c/DST_DB.c
- Timestamp:
- Mar 25, 2015 5:12:16 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/zasc/app_c/DST_DB.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/zasc/app_c/DST_DB.c
r22 r26 650 650 // Á֯ļö ¼³Á¤¿¡¼ Á¦¿ÜµÈ ä³ÎÀÎÁö? 651 651 // ÀԷ°ªÀº rfÀÇ index °ªÀÌ´Ù 652 boolDST_DB_IsExceptRF(int rf)653 { 654 if (DST_EEPROM_GetFrequencySetting() == 0) return false;655 if (rf < DST_EEPROM_GetMinRF()) return false;656 if (rf > DST_EEPROM_GetMaxRF()) return false;657 return true;652 int DST_DB_IsExceptRF(int rf) 653 { 654 if (DST_EEPROM_GetFrequencySetting() == 0) return 0; 655 if (rf < DST_EEPROM_GetMinRF()) return 0; 656 if (rf > DST_EEPROM_GetMaxRF()) return 0; 657 return 1; 658 658 } 659 659 … … 665 665 } 666 666 667 static int GetNextRF(int rf) 668 { 669 if (rf >= DST_MaxRF()) return 0; 670 return rf+1; 671 } 667 672 // Á¦¿ÜµÇÁö ¾ÊÀº ´ÙÀ½ RFÀÇ index°ªÀ» °¡Á®¿Â´Ù 673 // ÀÔ·ÂµÈ °ªÀº ÇöÀç indexed rf ´Ù 668 674 int DST_DB_GetNextUnexceptRF(int rf) 669 675 { 670 if (DST_EEPROM_GetFrequencySetting() == 0) return 0; 671 return DST_EEPROM_GetMaxRF() - DST_EEPROM_GetMinRF() + 1; 672 } 676 int i=0; 677 if (DST_EEPROM_GetFrequencySetting() == 0) 678 { 679 return GetNextRF(rf); 680 } 681 int curRF = rf; 682 for (i = DST_MinRF(); i <= DST_MaxRF(); i++) 683 { 684 curRF = GetNextRF(curRF); 685 if (DST_DB_IsExceptRF(curRF) == 0) return curRF; 686 } 687 return 0; 688 } 689 690 static int GetPrevRF(int rf) 691 { 692 if (rf <= DST_MinRF()) return DST_MaxRF(); 693 return rf-1; 694 } 695 // Á¦¿ÜµÇÁö ¾ÊÀº ´ÙÀ½ RFÀÇ index°ªÀ» °¡Á®¿Â´Ù 696 // ÀÔ·ÂµÈ °ªÀº ÇöÀç indexed rf ´Ù 697 int DST_DB_GetPrevUnexceptRF(int rf) 698 { 699 int i=0; 700 if (DST_EEPROM_GetFrequencySetting() == 0) 701 { 702 return GetPrevRF(rf); 703 } 704 int curRF = rf; 705 for (i = DST_MinRF(); i <= DST_MaxRF(); i++) 706 { 707 curRF = GetPrevRF(curRF); 708 if (DST_DB_IsExceptRF(curRF) == 0) return curRF; 709 } 710 return 0; 711 } 712 713 int DST_DB_GetUnexceptedFirstRF() 714 { 715 int i=0; 716 for (i = DST_MinRF(); i <= DST_MaxRF(); i++) 717 { 718 if (DST_DB_IsExceptRF(i) == 0) return i; 719 } 720 return DST_MinRF(); 721 } 722 723 int DST_DB_GetUnexceptedLastRF() 724 { 725 int i=0; 726 for (i = DST_MaxRF(); i >= DST_MinRF(); i--) 727 { 728 if (DST_DB_IsExceptRF(i) == 0) return i; 729 } 730 return DST_MaxRF(); 731 }
Note: See TracChangeset
for help on using the changeset viewer.
