Just watched an assessment of Jonathan Edwards' resolutions, and pietism, by Joe Rigney and Doug Wilson.
At one point Doug says that the Holy Spirit is the comforter and the devil is the accuser, and morbidly introspective folks get this backwards. They think any felt accusation is a sign of piety.
This is a good point, when addressing a pietist, but unbalanced, in the abstract. The Spirit can also convict. The devil can give false comfort. Rationalizing sin away is at least as prevalent as pietism.
The devil is in the details, or in this case, in the direct object. What are you feeling accused OF?
Drinking a soda, when that isn't a sin? Then yes, it's the devil trying to condemn you without cause.
Feeling accused of a real sin you really committed, but have also really repented of? Devil again.
Is it a real sin, and your repentance is fake, or half-hearted, and you are really cherishing the sin? Spirit conviction is at work!
Run the same diagnostic tests on the comfort side: are the feelings of comfort coming to you grounded in grace and forgiveness, or in justifying or explaining away continued sin?
And the principles you have to judge by are very well covered by the "Puritan checklists" Rigney and Wilson were discussing, such as Religious Affections, by Jonathan Edwards.