m2tklib icon indicating copy to clipboard operation
m2tklib copied to clipboard

Unable to unset Pin assignment

Open GoogleCodeExporter opened this issue 9 years ago • 1 comments

What steps will reproduce the problem?
1.setpin to pin 28
2.unset pin?

Alternate
1. setpin to pin 28 (valid pin)
2. setpin to pin 32 (only 31 pins on chip)


What is the expected output? What do you see instead?
I have a pin that i would like to toggle function.  if &m2_null_element, it 
functions one way.  if in menus, it functions as select.  So i need to set and 
unset the pin assignment.  RIght now no way to do that.  I have to set to an 
unused pin, however I have a scenario where no extra pin will be available.

In the alternate scenario, I cant get into the menus (crash of sorts)

I would like either an "unsetpin" command, or to be able to 
m2.setPin(M2_KEY_SELECT, null);

Original issue reported on code.google.com by [email protected] on 9 Jun 2015 at 3:46

GoogleCodeExporter avatar Jun 19 '15 20:06 GoogleCodeExporter

ok, so far noone has requested such a function.
Maybe add the following function to the end of m2pin.c

void m2_UnsetPin(uint8_t key)
{
  m2_key_to_pin_array[idx].status &= ~M2_IS_KEY_ASSIGNED;
}

calling this function may solve proproblem, but i have not tested this.



Original comment by [email protected] on 9 Jun 2015 at 6:47

GoogleCodeExporter avatar Jun 19 '15 20:06 GoogleCodeExporter