Possible errors in code

nigel may

New member
Hi,I have purchased 3 x Teensy 3v6 + Audio board.
I have been working on trying to get a successful compile for the Teensy Bat Detector project.
Using Cor Berrevoets version. TEENSY 3.6 BAT DETECTOR V0.1 20180814 from the forum post #159.

While trying to examine and resolve the errors that have been flagged I believe I have stumbled across some errors in code.

It would appear that custer rather than cluster has been used in three files as the indicated lines should show.

SD/file_t3.cpp line 100

SD/dir_t3.cpp line 96 145 190 224

SD/SD_t3.h line 200

I hope that this is useful and correct.

Nigel May
 
Hi GremlinWrangler, thank you for your reply.

I had tried to PM Paul Stoffregen as these files are his creation. It was also my very first post to this site which refused my PM.
I felt the files concerned were not specific to the bat detector code alone. My concerns were that someone could confirm the errors. My experience to quote what the effect of these errors may be is zero.

I have been following the development of the T4 and noticed the SD software was flagged as ok.

I am sure custer should have his 'last stand'

PaulStoffregen/SD


SD/file_t3.cpp line 100 uint32_t lba = custer_to_sector(current_cluster);

SD/dir_t3.cpp line 96 lba = custer_to_sector(current_cluster) + sector_offset;

145 lba = custer_to_sector(current_cluster);

190 lba = custer_to_sector(start_cluster);

224 lba = custer_to_sector(current_cluster);

SD/SD_t3.h line 200 static inline uint32_t custer_to_sector(uint32_t n) {

Apologies if this is not the way to do things but this is my second post.

I just feel this is a ghost error if that is what I can call it. The code is working but must be doing something? but not producing an obvious effect.

nm
 
Opps, yes, that is a typo in the source code! My fault. ;)

However, that code is not used at all unless you enable the optimization stuff in SD_t3.h (define USE_TEENSY3_OPTIMIZED_CODE). You can confirm this by adding obvious syntax errors. That code isn't even compiled unless you've turned on the special optimization, which is off by default. That optimization work was done years ago and sort-of abandoned. It only reads the card, but has no write support. It also only supports SPI, not SDHC for the native SD card socket on Teensy 3.6 (it was written before 3.6 existed).
 
Back
Top