Skip to content

Commit

Permalink
Add feauture: Developers now can put any files they want on BLE Micro…
Browse files Browse the repository at this point in the history
… Pro

File size < 8KB
Total Number of File < 15
    The number of default files will be increase in future
  • Loading branch information
sekigon-gonnoc committed Oct 3, 2019
1 parent 7d81258 commit 51668d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions keyboards/ble_micro_pro/ble_micro_pro.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ble_micro_pro.h"
#include <string.h>

void keyboard_post_init_user()
{
debug_enable = false;
}

void create_user_file()
{
static const char qmk_configurator[] = "<meta http-equiv=\"refresh\" content=\"0;URL=\'https://takashiski.github.io/qmk_configurator\'\"/>";
BMPAPI->usb.create_file("MAP_EDITHTM", (uint8_t*)qmk_configurator, strlen(qmk_configurator));
}
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
Expand Down
8 changes: 6 additions & 2 deletions tmk_core/protocol/nrf/bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,12 @@ static inline void update_tapping_term_string(bmp_api_config_t const * config,
BMPAPI->usb.create_file("TAPTERM JSN", (uint8_t*)str, strlen(str));
}

__attribute__ ((weak))
void create_user_file() { }

static inline void create_info_file()
{
static char info[] =
static const char info[] =
"API version: " STR(API_VERSION) "\n"
"Config version: " STR(CONFIG_VERSION) "\n"
"Build from " STR(GIT_HASH) STR(GIT_HAS_DIFF)"\n"
Expand All @@ -466,7 +469,7 @@ static inline void create_info_file()

static inline void create_index_html()
{
static char index_html[] = "<meta http-equiv=\"refresh\" content=\"0;URL=\'https://github.com/sekigon-gonnoc/BLE-Micro-Pro/tree/master/AboutDefaultFirmware\'\"/>";
static const char index_html[] = "<meta http-equiv=\"refresh\" content=\"0;URL=\'https://github.com/sekigon-gonnoc/BLE-Micro-Pro/tree/master/AboutDefaultFirmware\'\"/>";
BMPAPI->usb.create_file("INDEX HTM", (uint8_t*)index_html, strlen(index_html));
}

Expand All @@ -483,6 +486,7 @@ bmp_error_t bmp_state_change_cb(bmp_api_event_t event)
update_tapping_term_string(config, qmk_config_string, sizeof(qmk_config_string));
create_info_file();
create_index_html();
create_user_file();
break;
default:
break;
Expand Down

0 comments on commit 51668d9

Please sign in to comment.