aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F7xx/USB_RAW/usbcfg.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-26 10:06:37 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-26 10:06:37 +0000
commite628eeb8528f8d23d47ca5bf04ab0ee4fe3238ca (patch)
tree517c755ff9c0440526906985d15083595d83bebc /testhal/STM32/STM32F7xx/USB_RAW/usbcfg.c
parentc2a407c4d58b69cda4c1f7504bbf79c1aeffb594 (diff)
downloadChibiOS-e628eeb8528f8d23d47ca5bf04ab0ee4fe3238ca.tar.gz
ChibiOS-e628eeb8528f8d23d47ca5bf04ab0ee4fe3238ca.tar.bz2
ChibiOS-e628eeb8528f8d23d47ca5bf04ab0ee4fe3238ca.zip
Removed idle working area from the 'ch' structure because alignment constraints.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8949 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F7xx/USB_RAW/usbcfg.c')
0 files changed, 0 insertions, 0 deletions
'>142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
# Userspace: Sharing Code Between Keymaps

If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure:

* `/users/<name>/` (added to the path automatically)
  * `readme.md` (optional, recommended)
  * `rules.mk` (included automatically)
  * `config.h` (included automatically)
  * `<name>.h` (optional)
  * `<name>.c` (optional)
  * `cool_rgb_stuff.c` (optional)
  * `cool_rgb_stuff.h` (optional)


All this only happens when you build a keymap named `<name>`, like this:

    make planck:<name>

For example,

    make planck:jack

Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`.  

!> This `name` can be [overridden](#override-default-userspace), if needed.  

## `Rules.mk`

The `rules.mk` is one of the two files that gets processed automatically.  This is how you add additional source files (such as  `<name>.c`) will be added when compiling.

It's highly recommended that you use `<name>.c` as the default source file to be added. And to add it, you need to add it the SRC in `rules.mk` like this:

    SRC += <name>.c

Additional files may be added in the same way - it's recommended you have one named `<name>`.c/.h to start off with, though. 

The `/users/<name>/rules.mk` file will be included in the build _after_ the `rules.mk` from your keymap. This allows you to have features in your userspace `rules.mk` that depend on individual QMK features that may or may not be available on a specific keyboard. 

For example, if you have RGB control features shared between all your keyboards that support RGB lighting, you can add support for that if the RGBLIGHT feature is enabled:
```make
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  # Include my fancy rgb functions source here
  SRC += cool_rgb_stuff.c
endif
```

Alternatively, you can `define RGB_ENABLE` in your keymap's `rules.mk` and then check for the variable in your userspace's `rules.mk` like this: