- Customize your work environment. This is rarely mentioned, but it's a very effective way to keep you interested in programming. All the best SWEs I know customized their work environment heavily. I've basically never lost interest on programming, even on the most boring projects I've worked on, mainly because just "typing" on my vim/terminal is so fun!
- Learn other engineering branches. When I don't feel like coding, I design and print a lot of 3D printer stuffs. I build/program RC cars/quadcopters. Then somewhere in the process, I'll be like "hey I can program it to do this!" And I'm back to having fun with my computer.
- Don't burnout. I have the feeling you may have some early symptoms of burning out. Go play games and hangout with loved ones.
- Know what _really_ makes you unhappy. Is that the work truly soul crushing? Are you trying to get promoted, but felt like you can't even though you are trying hard? Work environment? Lack of sleep? You usually can't debug a problem without knowing what causes it. So take some time and reflect about it.
Hope things get better for you :). And keep it up!