# HG changeset patch # User Mychaela Falconia # Date 1622347293 0 # Node ID 16bee7b6bd6b1a462ea5f0e05aca6cd27e72376c # Parent 03457a66d860197a8a12d1625984388bc8a668b5 buzplayer: PWT needs to be turned on in order to not hang diff -r 03457a66d860 -r 16bee7b6bd6b target-utils/buzplayer/pwt.c --- a/target-utils/buzplayer/pwt.c Sun May 30 03:39:58 2021 +0000 +++ b/target-utils/buzplayer/pwt.c Sun May 30 04:01:33 2021 +0000 @@ -16,6 +16,20 @@ #define PWT_GCR_REG (*(volatile u8 *) 0xFFFE8802) void +pwt_on() +{ + ASIC_CONF_REG |= PWT_MODE_MASK; + PWT_GCR_REG = 0x01; +} + +void +pwt_off() +{ + ASIC_CONF_REG &= ~PWT_MODE_MASK; + PWT_GCR_REG = 0; +} + +void cmd_pwt(argbulk) char *argbulk; { @@ -23,13 +37,11 @@ if (parse_args(argbulk, 1, 1, argv, 0) < 0) return; - if (!strcmp(argv[0], "on")) { - ASIC_CONF_REG |= PWT_MODE_MASK; - PWT_GCR_REG = 0x01; - } else if (!strcmp(argv[0], "off")) { - ASIC_CONF_REG &= ~PWT_MODE_MASK; - PWT_GCR_REG = 0; - } else + if (!strcmp(argv[0], "on")) + pwt_on(); + else if (!strcmp(argv[0], "off")) + pwt_off(); + else printf("ERROR: \"on\" or \"off\" argument expected\n"); } @@ -56,6 +68,7 @@ } } else vol = 63; + pwt_on(); PWT_FRC_REG = note; PWT_VCR_REG = (vol << 1) | 1; for (;;) {