[En-Nut-Discussion] Contributions: vs1001 and microdelay

Mgr. Pavel Chromy chromy at asix.cz
Thu Apr 3 22:15:01 CEST 2003


Hello Harald,

Here are the sources I promised in my last email

I have completely revised vs1001.c which did not work for me at all.
I have found a few serious and many minor bugs.

I have attached 3 vs1001k sources:

vs1001k_commented.c - contains original code with my comments about
the bugs quoted by !! (double exclamanation mark)

vs1001k_minchanges.c - contains original code with minimal changes
which make it work

vs1001k.c - _completely_ revised code with added functionality,
which works perfectly for me.

- I removed some rather limiting parts of the code
  (e.g. watermark checking - everything explained in my comments in vs1001_commented.c)
- Playback can be stopped and resumed
- Round buffer management without keeping redundant information
  (data counter not necessary)
- Internal vs1001 buffer is flushed on request at the end of the
  playback in the interrupt routine.
- Does not disable all interrups, just the one which is necessary.
- Code which mihght possibly hang (if the decoder failes) was fixed
- Bugs which may cause crossing buffer coundary and more...
- Everything is now more clean and simple.

Added functions (commented in the source code):
extern int VsPlayerStop(void);
extern int VsPlayerFlush(void);
extern u_short VsBufferAvailable(void);
extern u_short VsPlayTime(void);
extern u_char VsGetStatus(void);

--
There is also source timer.c containing function NutMicroDelay()
for precise timing (microsecond). It does not take calling
overhead into account, but this is less that a microsecond.
It is clock speed dependant, since it is a hard task to do it
otherwise.
This tiny function is pretty usefull when controlling attached devices
so I thought that you might want to add it to the distribution.


Mgr. Pavel Chromy
ASIX s.r.o.
Staropramenna 4
150 00 Praha 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: microdelay.zip
Type: application/x-zip-compressed
Size: 594 bytes
Desc: not available
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20030403/43b94b71/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vs1001k.zip
Type: application/x-zip-compressed
Size: 19221 bytes
Desc: not available
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20030403/43b94b71/attachment-0003.bin>


More information about the En-Nut-Discussion mailing list