Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Plugins

Gal Zaidenstein edited this page Sep 21, 2019 · 4 revisions

Plugins

MK32 currently supports launching one plugin at a time by an assigned key.
In order to close the plugin you need to assign a key for PN_CLOSE.

Assign a plugin

In order to add a plugin to be assigned to a keypress:

  1. place it's files in MK32/plugins.
  2. Include the plugin's header file in plugins.h.
  3. modify plugin_keycodes to add the keycode to launch the plugin, do not remove PN_CLOSE:
enum plugin_keycodes {
	PN_CLOSE = PLUGIN_BASE_VAL,
	PN_LAYOUT,
	PN_TEST
};
  1. Add a case for you plugin's keycode in plugins.c using start_plugin_task:
		case PN_TEST:
			start_plugin_task(testFunc, 0, 0);
			break;

usage:

/*
 * @brief start a plugin FreeRTOS task
 * @param plugin pass a function to be opened as the plugin
 * @param wifi_enable set 0 if function does not require wiFi
 * @param block_ble_report set 0 if you do not wish to block keyboard reports
 */
void start_plugin_task(func_t plugin, int wifi_enable, int block_ble_report);

Notes:

  • If your plugin required WiFi, you can set the default SSID and Password in plugins.h, a plugin to add an AP configuration to flash will be added eventually.
Clone this wiki locally