> If I write a program that downloaded fitness data from my Garmin smartwatch and mentioned "compatible with Garmin smartwatches" on the project's GitHub, am I suddenly infringing their trademark?
Not necessarily, but you'd have to be careful. Depending on exactly where and how you say it, a lawyer might be able to ethically argue that a reasonable consumer could think you're claiming to have a partnership with Garmin. In particular, it would be very risky to use their logo, which it sounds like the OP may have.
(This isn't an actual legal test, but something to drive the intuition why it could be a legitimate trademark issue: if a consumer buys your product and it doesn't actually work with their Garmin, will they blame you or blame Garmin?)