Thanks for your query.Based on the facts that you have posted it appears that you have applied excessive pressure to your penis by holding it tightly between legs for a long time and now not getting erection .
This is most likely to be due trivial injury
to corpora cavernosa due to excessive pressure.
Please take anti inflammatory medication like Diclofenac
twice daily for a week.
If the problem persists you may need to get Penile Doppler Scan done to rule ourt ant severe injury to corpora and blood vessels.