Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EM4x50 simulation (Not complete yet) #171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Shanti67
Copy link

@Shanti67 Shanti67 commented Apr 6, 2016

Add EM4x50 simulation (Not complete yet)

Add EM4x50 simulation (Not complete yet)
@holiman
Copy link
Contributor

holiman commented May 20, 2016

I don't know if it's ready to merge, as it says "not complete yet" ?
Also, could you try to abstract away a bit from the loops, things like:

period += T0*EM4x50_T_HALF_PERIOD;
LOW(GPIO_SSC_DOUT);
while (AT91C_BASE_TC0->TC_CV < period);
period += T0 * 3 * EM4x50_T_HALF_PERIOD;
HIGH(GPIO_SSC_DOUT);
while (AT91C_BASE_TC0->TC_CV < period);
period += T0 * EM4x50_T_HALF_PERIOD;
LOW(GPIO_SSC_DOUT);
while (AT91C_BASE_TC0->TC_CV < period);
period += T0 * 3 * EM4x50_T_HALF_PERIOD;
HIGH(GPIO_SSC_DOUT);
while (AT91C_BASE_TC0->TC_CV < period);
period += T0 * EM4x50_T_HALF_PERIOD;
LOW(GPIO_SSC_DOUT);
while (AT91C_BASE_TC0->TC_CV < period);

And instead move that into some function so it's easier on the eyes. Something like this:

em4x_mod_high(1)
em4x_mod_low(1)
em4x_mod_high(3)

(Note: I haven't actually dug deep enough to know if my sample code above makes sense, but something like it should work )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants