olikraus / m2tklib

Automatically exported from code.google.com/p/m2tklib
Other
49 stars 11 forks source link

Unable to unset Pin assignment #152

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 trance...@gmail.com on 9 Jun 2015 at 3:46

GoogleCodeExporter commented 9 years ago
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 olikr...@gmail.com on 9 Jun 2015 at 6:47