Skip to content

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