fork download
  1. #include <stdio.h>
  2.  
  3. typedef enum
  4. {
  5. PORT_LOCK_P00 = 0x00000002,
  6. PORT_LOCK_P01 = 0x00000004,
  7. PORT_LOCK_P02 = 0x00000008,
  8. PORT_LOCK_P03 = 0x00000010,
  9. PORT_LOCK_P04 = 0x00000020,
  10. PORT_LOCK_P05 = 0x00000040,
  11. PORT_LOCK_P06 = 0x00000080,
  12. PORT_LOCK_P08 = 0x00000100,
  13. PORT_LOCK_P09 = 0x00000200,
  14. PORT_LOCK_P10 = 0x00000400,
  15. PORT_LOCK_P11 = 0x00000800,
  16. PORT_LOCK_P12 = 0x00001000,
  17. PORT_LOCK_P17 = 0x00002000,
  18. PORT_LOCK_P18 = 0x00004000,
  19. PORT_LOCK_P19 = 0x00008000,
  20. PORT_LOCK_P20 = 0x00010000,
  21. PORT_LOCK_P21 = 0x00020000,
  22. PORT_LOCK_P22 = 0x00040000,
  23. PORT_LOCK_P23 = 0x00080000,
  24. PORT_LOCK_P24 = 0x00100000,
  25. PORT_LOCK_AP0 = 0x00200000,
  26. PORT_LOCK_AP1 = 0x00400000,
  27. PORT_LOCK_AP2 = 0x00800000,
  28. PORT_LOCK_AP3 = 0x01000000,
  29. PORT_LOCK_AP4 = 0x02000000,
  30. PORT_LOCK_AP5 = 0x04000000,
  31. PORT_LOCK_LVDS = 0x08000000
  32. } port_lock_t;
  33.  
  34. const port_lock_t PortL_Array[] = {
  35. PORT_LOCK_P00,
  36. PORT_LOCK_P01,
  37. PORT_LOCK_P02,
  38. PORT_LOCK_P03,
  39. PORT_LOCK_P04,
  40. PORT_LOCK_P05,
  41. PORT_LOCK_P06,
  42. PORT_LOCK_P08,
  43. PORT_LOCK_P09,
  44. PORT_LOCK_P10,
  45. PORT_LOCK_P11,
  46. PORT_LOCK_P12,
  47. PORT_LOCK_P17,
  48. PORT_LOCK_P18,
  49. PORT_LOCK_P19,
  50. PORT_LOCK_P20,
  51. PORT_LOCK_P21,
  52. PORT_LOCK_P22,
  53. PORT_LOCK_P23,
  54. PORT_LOCK_P24,
  55. PORT_LOCK_AP0,
  56. PORT_LOCK_AP1,
  57. PORT_LOCK_AP2,
  58. PORT_LOCK_AP3,
  59. PORT_LOCK_AP4,
  60. PORT_LOCK_AP5,
  61. PORT_LOCK_LVDS
  62. };
  63.  
  64. const unsigned int CfgCnt = sizeof(PortL_Array) / sizeof(PortL_Array[0]);
  65.  
  66. void PORT_Unlock(port_lock_t port_unlock)
  67. {
  68. printf ("The value of port_unlock is hex integer %x \n", port_unlock);
  69. }
  70.  
  71. void InitUnlock(const port_lock_t port[], unsigned char cnt)
  72. {
  73. unsigned long int msk;
  74. unsigned char n;
  75.  
  76. msk = (unsigned long int)0x0;
  77.  
  78. for (n = 0; n < cnt; n++)
  79. {
  80. msk |= port[n];
  81. }
  82.  
  83. PORT_Unlock(msk);
  84. }
  85.  
  86. int main (void)
  87. {
  88. InitUnlock(PortL_Array, CfgCnt);
  89.  
  90. return 0;
  91. }
Success #stdin #stdout 0s 4312KB
stdin
Standard input is empty
stdout
The value of port_unlock is hex integer ffffffe