Author Topic: preprocessor macro _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_HIGH  (Read 25220 times)

Offline fabius

  • Newbie
  • *
  • Posts: 5
    • View Profile
Hello,

in my uTasker version (1.4) the preprocessor macro _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_HIGH uses the same bit shifting routine as in _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_LOW function to align the adress bits for the PORTx_GPCHR register. (kinetis.h)

PORT##ref##_GPCLR = (((pins) << 16) | (chars | PORT_MUX_GPIO)) is used in both functions.

Is the function correct or is there a defect in my version ?

I expected a function like PORTx_GPCHR = (((pins) & 0xffff0000) | chars | PORT_MUX_GPIO) there.

Regards

Fabian

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3244
    • View Profile
    • uTasker
Re: preprocessor macro _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_HIGH
« Reply #1 on: May 15, 2014, 02:32:10 PM »
Fabian

I think that you are using an older version where there was an error in this macro.
There was a correction:
    27.11.2013 Correct _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_HIGH() macro {39}
and the two macros now are like this:

Quote
#define _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_LOW(ref, pins, value, chars) SIM_SCGC5 |= SIM_SCGC5_PORT##ref; PORT##ref##_GPCLR = (((pins) << 16) | (chars | PORT_MUX_GPIO)); GPIO##ref##_PDOR = ((GPIO##ref##_PDOR & ~((pins) & 0x0000ffff)) | ((value) & 0x0000ffff)); GPIO##ref##_PDDR |= ((pins) & 0x0000ffff); _SIM_PORT_CHANGE // {12}
#define _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_HIGH(ref, pins, value, chars) SIM_SCGC5 |= SIM_SCGC5_PORT##ref; PORT##ref##_GPCHR = (((pins) & 0xffff0000) | (chars | PORT_MUX_GPIO)); GPIO##ref##_PDOR = ((GPIO##ref##_PDOR & ~((pins) & 0xffff0000)) | ((value) & 0xffff0000)); GPIO##ref##_PDDR |= ((pins) & 0xffff0000); _SIM_PORT_CHANGE // {12}{39}


Regards

Mark