Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8857359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:34:13+00:00 2026-06-14T14:34:13+00:00

I have a code for the micro-controller in C. Basing on the examples I

  • 0

I have a code for the micro-controller in C.
Basing on the examples I have, I use the function “void osSleep(tU32 ticks)” to stop the program for a while. Unfortunately, I don’t know how it really works and what it does to my micro-controller (what pins, states etc. are set to what values).

I have figured out the setBuzzer() function because I have it’s source:

void setBuzzer(tBool on)
{
  if (TRUE == on)
    IOCLR = BUZZER_PIN;
  else
    IOSET = BUZZER_PIN;
}

So the GPIO port is set to 1 or 0 for the PIN related to buzzer (BUZZER_PIN = 0x00002000). Buzzer has one pin so I can just enable and disable it (high and low voltage).

I would like to make similar analyse for osSleep(), but what’s strange, I cannot find it’s implementation in the whole code, only declaration:

void osSleep(tU32 ticks);

Maybe that function is in some library. Anyway, I want to know how it really works on the lower level (e.g. what happens with the timer when I call it, what instructions are execute – like in the buzzer example).

Also, there is only a high-level short definition in the documentation for the code called “Pre-emptive Operating System v 1.4.0” by Embedded Artists.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:34:14+00:00Added an answer on June 14, 2026 at 2:34 pm

    Unfortunately, I don’t know how it really works and what it does to my micro-controller

    Without access to the source, there’s no way to be sure. Try using a disassembler (GNU’s binutils has objdump, e.g.) to understand what the actual osSleep does.

    In all likelihood, it’s pending on a semaphore that will get toggled (directly or indirectly) by the timer tick ISR. Your question is interesting, though — the documentation mentions nothing other than “This function puts a process to sleep for the specified number of ticks.” but it certainly could put the entire uC into a lower-power mode if none were available to run.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have large C code base for a micro-controller. I am working on a
On a micro-controller program I have a few instructions that I would like to
I have the c code for the micro-controller with buzzer. It works, but I
I have found this macro while digging in the source code of tweejump game.
I have code like this in my view model: function ChatListViewModel(chats) { var self
I have code in a managed bean: public void setTestProp(String newProp) { FacesMessage yourFailure
I have code that generates a List<string[]> variable but can't quite figure out how
I have code which has a drop down list. And when a certain option
I have code that looks more or less like the code below but it
I have code to create a live screenshot of the stage in my swf.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.