Change API of chopstx_setpriority

This commit is contained in:
NIIBE Yutaka
2016-07-01 09:51:32 +09:00
parent c7e571eca0
commit f5880ee5d5
4 changed files with 35 additions and 16 deletions

View File

@@ -27,6 +27,10 @@ static chopstx_intr_t tpm1_intr;
uint16_t
touch_get (void)
{
chopstx_prio_t prio_old;
prio_old = chopstx_setpriority (CHOPSTX_PRIO_INHIBIT_PREEMPTION);
/* Assert LOW. */
PORTB->PCR1 = (1<<8) /* GPIO */
| (0<<6) /* DriveStrengthEnable=0 */
@@ -51,6 +55,8 @@ touch_get (void)
| (0<<0) /* puddselect= 0 */
;
chopstx_setpriority (prio_old);
chopstx_intr_wait (&tpm1_intr);
/* Clear overflow and CH1 capture. */
TPM1->STATUS = 0x102;