Modify the file main.cpp for M487

Committer:
shliu1
Date:
Fri Sep 29 05:44:02 2017 +0000
Revision:
0:a67fc999dd68
main.cpp adds the setting of TARGET_NUMAKER_PFM_M487 for M487

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shliu1 0:a67fc999dd68 1 /* mbed Microcontroller Library
shliu1 0:a67fc999dd68 2 * Copyright (c) 2016 ARM Limited
shliu1 0:a67fc999dd68 3 *
shliu1 0:a67fc999dd68 4 * Licensed under the Apache License, Version 2.0 (the "License");
shliu1 0:a67fc999dd68 5 * you may not use this file except in compliance with the License.
shliu1 0:a67fc999dd68 6 * You may obtain a copy of the License at
shliu1 0:a67fc999dd68 7 *
shliu1 0:a67fc999dd68 8 * http://www.apache.org/licenses/LICENSE-2.0
shliu1 0:a67fc999dd68 9 *
shliu1 0:a67fc999dd68 10 * Unless required by applicable law or agreed to in writing, software
shliu1 0:a67fc999dd68 11 * distributed under the License is distributed on an "AS IS" BASIS,
shliu1 0:a67fc999dd68 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
shliu1 0:a67fc999dd68 13 * See the License for the specific language governing permissions and
shliu1 0:a67fc999dd68 14 * limitations under the License.
shliu1 0:a67fc999dd68 15 */
shliu1 0:a67fc999dd68 16 #include "NuBrickMasterTemp.h"
shliu1 0:a67fc999dd68 17
shliu1 0:a67fc999dd68 18 NuBrickMasterTemp::NuBrickMasterTemp(I2C &i2c, bool debug) :
shliu1 0:a67fc999dd68 19 NuBrickMaster(i2c, NuBrick_I2CAddr_Temp, debug) {
shliu1 0:a67fc999dd68 20
shliu1 0:a67fc999dd68 21 static const NuBrickField::IndexName temp_feature_field_index_name_arr[] = {
shliu1 0:a67fc999dd68 22 NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex1_Plus1, "sleep_period"),
shliu1 0:a67fc999dd68 23 NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex2_Plus1, "temp_AT"),
shliu1 0:a67fc999dd68 24 NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex3_Plus1, "hum_AT")
shliu1 0:a67fc999dd68 25 };
shliu1 0:a67fc999dd68 26
shliu1 0:a67fc999dd68 27 static const NuBrickField::IndexName temp_input_field_index_name_arr[] = {
shliu1 0:a67fc999dd68 28 NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex1_Plus1, "temp"),
shliu1 0:a67fc999dd68 29 NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex2_Plus1, "hum"),
shliu1 0:a67fc999dd68 30 NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex3_Plus1, "temp_over_flag"),
shliu1 0:a67fc999dd68 31 NuBrickField::IndexName(NuBrick_ReportDesc_FieldIndex4_Plus1, "hum_over_flag")
shliu1 0:a67fc999dd68 32 };
shliu1 0:a67fc999dd68 33
shliu1 0:a67fc999dd68 34 // Add fields of feature report
shliu1 0:a67fc999dd68 35 add_feature_fields(temp_feature_field_index_name_arr,
shliu1 0:a67fc999dd68 36 sizeof (temp_feature_field_index_name_arr) / sizeof (temp_feature_field_index_name_arr[0]));
shliu1 0:a67fc999dd68 37
shliu1 0:a67fc999dd68 38 // Add fields of input report
shliu1 0:a67fc999dd68 39 add_input_fields(temp_input_field_index_name_arr,
shliu1 0:a67fc999dd68 40 sizeof (temp_input_field_index_name_arr) / sizeof (temp_input_field_index_name_arr[0]));
shliu1 0:a67fc999dd68 41
shliu1 0:a67fc999dd68 42 // Add fields of output report
shliu1 0:a67fc999dd68 43
shliu1 0:a67fc999dd68 44 // No lock needed in the constructor
shliu1 0:a67fc999dd68 45
shliu1 0:a67fc999dd68 46 }