none
Sleep in OAL RRS feed

  • Question

  • Hi All,

    I am using Wince 4.2 os. I have to do a synchronisation between I2C RTC in OAL and EEPROM driver in BSP. I am  thinking of following link

    http://www.e-consystems.com/blog/windowsce/?p=121

    I have implemented the code. But there is no sleep function to use in OAL.

    I have tried OALStall, NKSleep and Sleep. But these functions are not availbale.

    Can you tell me which function to use in OAL to get sleep functionality.

    Regards,

    Wince User

    Friday, October 7, 2011 8:28 AM

Answers

  • In pre-CE6 kernel, these API usually implemented with SC_ prefix in kernel.
    So you may try SC_Sleep.
    Note that this is not a published API, so you need to declare the SC_Sleep prototype (should be the same as Sleep API) to make compiler happy.
    • Marked as answer by new_user_wince Tuesday, October 11, 2011 3:29 AM
    Monday, October 10, 2011 6:44 AM

All replies

  • If you need to delay the execution of the code you can use SC_GetTickCount (http://msdn.microsoft.com/en-us/site/ms903551) from the OAL.

    GetTickCount documentation (http://msdn.microsoft.com/en-us/library/ee487985.aspx) has some advice on using the function (comparison of different tick counts) which apply to SC_GetTickCount as well.


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Friday, October 7, 2011 1:22 PM
  • In his case this is not going to help. He's trying to synchronize between the I2C driver and I2C code in the OAL. Since the OAL has precedence over driver code this would lead to a deadlock if he can't relinquish the CPU to run the driver.

     

    He needs NKSleep, but for me CE 4.2 is too long ago to remember whether or not NKSleep was supported or if it was called differently. I find it very hard to believe there's no Sleep function in the OAL, but who knows in 4.2...


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.
    Friday, October 7, 2011 2:42 PM
    Moderator
  • Hi Michel ,

    Your understanding is correct. I need to synchronise between the I2C driver and I2C code in the OAL.

    I need a sleep function in OAL. I am not able to find any sleep function. Are you sure that there should be one sleep function in Wince 4.2.

    Or is there any other mechanism for synchrinisation?

    Regards,

    Wince User

     

    Sunday, October 9, 2011 3:43 PM
  • In pre-CE6 kernel, these API usually implemented with SC_ prefix in kernel.
    So you may try SC_Sleep.
    Note that this is not a published API, so you need to declare the SC_Sleep prototype (should be the same as Sleep API) to make compiler happy.
    • Marked as answer by new_user_wince Tuesday, October 11, 2011 3:29 AM
    Monday, October 10, 2011 6:44 AM
  • HI KMOS,

    It worked.... :)

    Thank you very much for your support. You have helped me alot in many posts. Thank you so much.

    Regards,

    Wince User.

     

    • Marked as answer by new_user_wince Monday, October 10, 2011 7:03 AM
    • Unmarked as answer by new_user_wince Tuesday, October 11, 2011 3:29 AM
    Monday, October 10, 2011 7:03 AM
  • You should then really mark KMOS's answer and the answer, and not your own reply...
    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: http://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.
    Monday, October 10, 2011 8:25 PM
    Moderator
  • :)

    Ok .Done.

    Tuesday, October 11, 2011 3:29 AM