Author Topic: Wrong mask used in macro _CONFIG_PORT_OUTPUT_FAST_HIGH  (Read 5954 times)

Offline fabius

  • Newbie
  • *
  • Posts: 5
    • View Profile
Wrong mask used in macro _CONFIG_PORT_OUTPUT_FAST_HIGH
« on: June 08, 2015, 03:48:56 PM »
Hello,

it seems to me, that an incorrect mask is used in the macro "_CONFIG_PORT_OUTPUT_FAST_HIGH" (uTasker 1.4.7 - kinetis.h)  to filter the relevant bits.
I think that  "GPIO##ref##_PDDR |= ((pins) & 0xffff);" needs to be changed to GPIO##ref##_PDDR |= ((pins) & 0xffff0000);.

The macro did not work with Keil until the value was changed.
Can you confirm this issue ?

Regards

Fabian

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Wrong mask used in macro _CONFIG_PORT_OUTPUT_FAST_HIGH
« Reply #1 on: June 08, 2015, 05:26:15 PM »
Hello Fabian

Indeed, the macro had the error that you identifed:
After correcting to
#define _CONFIG_PORT_OUTPUT_FAST_HIGH(ref, pins, chars) SIM_SCGC5 |= SIM_SCGC5_PORT##ref; PORT##ref##_GPCHR = (((pins) & 0xffff0000) | chars | PORT_MUX_GPIO); GPIO##ref##_PDDR |= ((pins) & 0xffff0000); _SIM_PORT_CHANGE; _SIM_PER_CHANGE // {65}
it is OK.
I didn't actually find the macro being used anywhere in the standard code, which tends to use _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_HIGH instead, which doesn't have the mask error.

During checking I verified that the other "FAST" macros are as they should be.

Thanks!!!

Mark